|
|
|
|
RegexSearch (Function) In french: RegexCherche Searches for all the parts of a string that follow a specific format. Remark: The specification used for regular expressions is ECMAScript. // Search for all the dates in a string // and retrieve days, months and years. sString is string = "The order will be delivered between 28/08/2020 and 02/09/2020." nFound is int = 0 arrDate is array of string arrDays is array of string arrMonths is array of string arrYears is array of string nFound = RegexSearch(sString,"([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})", ... arrDate, arrDays, arrMonths, arrYears) FOR i = 1 TO nFound TXT_Result += StringBuild("Date: %1 | Days: %2 | Months: %3 | Years: %4", ... arrDate[i], arrDays[i], arrMonths[i], arrYears[i]) TXT_Result += CR END
Syntax
<Result> = RegexSearch(<Source string 1> , <Format 1> , <Strings found> ... [, <Source string N> [, <Format N> [, <Strings found N>]]])
<Result>: Integer Number of strings found. <Source string 1>: Character string First string in which the search will be performed. <Format 1>: Character string Regular expression that indicates the format of the part of the string to search for in <Source string 1>. <Strings found>: Array of strings Name of the variable of type Array of string, which will contain the various substrings found in <Source string 1>. <Source string N>: Optional character string Nth string in which the search will be performed. <Format N>: Optional character string Regular expression that indicates the format of the part of the string to search for in <Source string N> <Strings found N>: Optional array of strings Name of the variable of type Array of string, which will contain the various substrings found in <Source string N>. Business / UI classification: Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|