- Escape character
- Special characters
- Use a condition in a regular expression
- Wizard for MatchRegularExpression
MatchRegularExpression (Function) In french: VérifieExpressionRégulière Syntax
Checking a format Hide the details
<Result> = MatchRegularExpression(<Element to check> , <Regular expression>)
<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. This character string must be written in Latin characters. <Regular expression>: Character string (with quotes) Reference format, expressed as a regular expression. This character string must be written in Latin characters. 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? | \W | Checks whether a special character is found (for example &, #, @, ...). |
Remark: The | character is used to define an "OR" condition.
Checking a format and retrieving the elements corresponding to the format Hide the details
<Result> = MatchRegularExpression(<Element to check> , <Regular expression> , <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. This character string must be written in Latin characters. <Regular expression>: Character string (with quotes) Reference format expressed as a regular expression. This character string must be written in Latin characters. 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. | \W | Checks whether a special character is found (for example &, #, @, ...). | ( ) | Delimit part of the format to extract. | { } | Number of repetitions allowed for the previous expression ({min, max} format). |
Remark: The | character is used to define an "OR" condition. <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. Versions 16 and later New in version 16
Related Examples:
|
Unit examples (WINDEV): The regular expressions
[ + ] Using regular expressions with WINDEV. Two use modes are presented for the regular expressions: - checking the input format - checking out different elements while respecting the input format. This example is also used to search for a word in a string. The search can be case-sensitive or not. Possibility to take into account (or not) the start or end of string, as well as spaces (anywhere in the string, even in the sought word)
|
|
Unit examples (WINDEV Mobile): The regular expressions
[ + ] Using regular expressions with WINDEV Mobile. It presents 2 modes for using the regular expressions: - check the input format - check out the different elements that match the input format. This example is also used to search for a word in a string. The search can be case-sensitive or not. Possibility to take into account (or not) the start or end of string, as well as spaces (anywhere in the string, even in the sought word)
|
|
Unit examples (WINDEV): Advanced input mask
[ + ] Handling the input masks in WINDEV: - Defining the format of positive/negative number in a numeric edit control - Defining how negative numbers will be displayed in a numeric edit control - Defining how the value 0 will be displayed in a numeric edit control - Using a regular expression to prevent from typing characters other than 1, 2, 3, 4, 5 and 6. - Using a regular expression to "regulate" the input of a French registration number
|
Business / UI classification : Neutral code
This page is also available for…
|
|
|