RegExTest
Returns true if the Val string matches the supplied regular expression.
Syntax
RegexTest (<value>, <expression> [, <ignore_case>])
Parameters
<value>
Type: Text
The text to be validated.
<expression>
Type: Text
The regular expression.
<ignore_case>
Type: Boolean
(Optional.) The default value is False.
Notes
ICU string types are not supported. For more information, see “Working With Unicode and ICU String Types”:
Example
The following example validates email addresses in a text variable:
emailAddress.RegexTest("^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$")
The following example validates US postal codes:
postCode.RegexTest("^[0-9]{5}(?:-[0-9]{4})?$")
The following example validates UK postcodes:
postCode.RegexTest("^[A-Z]{1,2}[0-9R][0-9A-Z]? [0-9][ABD-HJLNP-UW-Z]{2}$")
See also