|
|
|
|
RegexMatch (Function) In french: RegexVérifie Checks whether a string matches the 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.
TXT_Result is string
sString is string = "28/03/2003"
sDateFormat is string = "([0-9]+)/([0-9]+)/([0-9]+)"
sDay is string
sMonth is string
sYear is string
IF RegexMatch(sString, sDateFormat, sDay, sMonth, sYear) THEN
TXT_Result = "Days: " + sDay
TXT_Result += CR + "Month: " + sMonth
TXT_Result += CR + "Year: " + sYear
END
IF RegexMatch( EDT_LICENSEPLATE,
"(?i)[A-Z]{2}[-][0-9]{3}[-][A-Z]{2}" ) THEN
...
END
Syntax
Checking a format and retrieving the elements that match 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 Character string to check. <Format>: Character string Reference format. The specification used for regular expressions is ECMAScript. Remark: You can use "(?i)" at the beginning of the expression to make the verification case-insensitive. <Variable 1>: Character string, Integer, etc. Variable that will be automatically initialized with the value that matches the first part of the <Format>. Each part is defined by the '(' and ')' characters. <Variable N>: Character string, Integer, etc. Variable that will be automatically initialized with the value that matches the Nth part of the <Format>. Each part is defined by the '(' and ')' characters.
Checking a format and retrieving the elements that match 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 Character string to check. <Format>: Character string Reference format. The specification used for regular expressions is ECMAScript. Remark: You can use "(?i)" at the beginning of the expression to make the verification case-insensitive. <Array of strings>: Array Name of the array to be populated. The different elements of the array will be automatically initialized with the values that match the different parts of the <Format>. Business / UI classification: Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|