PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
fReadLineRegularExpression (Function)
In French: fLitLigneExpressionRégulière
Reads a line in an external file and retrieves in variables the sections of this line according to a regular expression.
This function is mainly used to easily analyze the log files.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Open an external file
FileID = fOpen("C:\MyDirectories\DataAccess.log", foRead)
IF FileID <> -1 THEN
      // Read a line in this file
// Format: 20001221  - Purchase
sDate is string
sInfo is string
fReadLineRegularExpression(FileID, "([0-8]*) - ([A-Z]*) ", sDate, sInfo)
...
END
Syntax
<Result> = fReadLineRegularExpression(<File Identifier>, <Format>, <Variable 1> [, ... [, <Variable N>]])
<Result>: Boolean
  • True if the data was read and retrieved.
  • False otherwise.
<File Identifier>: Integer
Identifier of file to use, defined by fOpen or fCreate.
<Format>: Character string (with quotes)
Reference format, expressed as a regular expression. This format uses the following characters:
A B C - / _Letters and symbols to check
[A-Z] or [0-9]Interval of letters, digits or symbols to check
*0 or more symbols to check
+1 or more symbols to check
( )Delimit part of the format to extract
{ }Number of repetitions allowed for the previous expression ({min, max} format)
<Variable 1>: Character string, Integer, ...
Variables that will be automatically initialized with the different parts of the format to extract. Each part is defined by the '(' and ')' characters.
<Variable N>: Character string, Integer, ...
Variables that will be automatically initialized with the different parts of the format to extract. Each part is defined by the '(' and ')' characters.
Components
WINDEVReports and Queries wd230std.dll
Minimum required version
  • Version 17
This page is also available for…
Comments
Click [Add] to post a comment