PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
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 24 and later
Windows This function is now available for the WEBDEV sites in Windows.
New in version 24
Windows This function is now available for the WEBDEV sites in Windows.
Windows This function is now available for the WEBDEV sites in Windows.
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-Za-z]*)", sDate, sInfo)
...
END
Syntax
<Result> = fReadLineRegularExpression(<File identifier> , <Format> , <Variable 1> [, <Variable 2> [... [, <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, etc.
Variables that will be automatically initialized with the different parts of the format to extract. Each part is defined by the '(' and ')' characters.
<Variable 2>: Character string, Integer, etc.
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, etc.
Variables that will be automatically initialized with the different parts of the format to extract. Each part is defined by the '(' and ')' characters.
Component : wd240std.dll
Minimum version required
  • Version 17
This page is also available for…
Comments
Click [Add] to post a comment