PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
New WINDEV, WEBDEV and WINDEV Mobile 26 feature!
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
Checks whether a string follows a format defined by a regular expression. The different substrings that make up the format can be retrieved.
The specification used for regular expressions is ECMAScript.
Example
TXT_Result is string
// Define the string to be tested and the format it should follow.
sString is string = "28/03/2003"
sDateFormat is string = "([0-9]+)/([0-9]+)/([0-9]+)"
 
// Variables used to retrieve the different parts of the format.
sDay is string
sMonth is string
sYear is string
 
// If the string matches the format, its different parts are displayed.
IF RegexMatch(sString, sDateFormat, sDay, sMonth, sYear) THEN
TXT_Result = "Days: " + sDay
TXT_Result += CR + "Month: " + sMonth
TXT_Result += CR + "Year: " + sYear
END
Syntax

Checking a format and retrieving the elements corresponding to the format Hide the details

<Result> = RegexMatch(<Element to check> , <Format> [, <Variable 1> [... [, <Variable N>]]])
<Result>: Boolean
  • True if the string matches the specified format,
  • False if the string does not match the format.
<Element to check>: Character string (with quotes)
Character string to check.
<Format>: Character string
Reference format. The specification used for regular expressions is ECMAScript.
<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 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.

Checking a format and retrieving the elements corresponding to the format in an array Hide the details

<Result> = RegexMatch(<Element to check> , <Format> , <Array of strings>)
<Result>: Boolean
  • True if the string matches the specified format,
  • False if the string does not match the format.
<Element to check>: Character string (with quotes)
Character string to check.
<Format>: Character string
Reference format. The specification used for regular expressions is ECMAScript.
<Array of strings>: Array
Name of array to fill. The different elements will be automatically initialized with the different sections of the format to extract.
Business / UI classification : Neutral code
Component : wd260std.dll
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment