|
|
|
|
|
<ANSI string>.RegexMatch (Function) In french: <Chaîne ANSI>.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. New in version 2025TXT_Résultat is string
sChaîne is string = "28/03/2003"
sFormatDate is string = "([0-9]+)/([0-9]+)/([0-9]+)"
sJour is string
sMois is string
sAnnée is string
IF sChaîne.RegexVérifie(sFormatDate, sJour, sMois, sAnnée) THEN
TXT_Résultat = "Jours : " + sJour
TXT_Résultat += CR + "Mois: " + sMois
TXT_Résultat += CR + "Année : " + sAnnée
END
MonEmail is string = "monemail@provider.com"
IF MonEmail.RegexVérifie("(?i)[^\.][a-zA-Z0-9._%&#{}+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z.-]{2,}$") THEN
Trace("L'email est syntaxiquement correct.")
END
UnMotDePasse is string = "MotDePasse$1"
IF UnMotDePasse.RegexVérifie("^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[^\w\s]).{8,}$") THEN
Trace("Le mot de passe est fort.")
END
MaChaîne is string = "1.618033"
IF MaChaîne.RegexVérifie("[-+]?[0-9]*\.?[0-9]*") THEN
Trace("La chaîne est un nombre entier ou décimal.")
END
AdresseIP is string
AdresseIP = "192.168.100.1"
IF AdresseIP.RegexVérifie("^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$") THEN
Trace("La chaîne est une adresse IP.")
END
Syntax
Checking a format and retrieving the elements that match the format Hide the details
<Result> = <Element to check>.RegexMatch(<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>: ANSI string variable Character string to check. <Format>: Character string Reference format. The specification used for regular expressions is ECMAScript. Note: You can use the string "(?i)" at the start of an expression to indicate that the check should be 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> = <Element to check>.RegexMatch(<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>: Control name Character string to check. <Format>: Character string Reference format. The specification used for regular expressions is ECMAScript. Note: You can use the string "(?i)" at the start of an expression to indicate that the check should be 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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|