syntax

result = regvalidate (expression, string)

Arguments

result: integer

expression, string: text

Meaning

Validates a string to a so called regular expression. Result = 0 if the string is formatted according to the provided regular expression, and result = 1 if the string does not comply to it.

Example 1

result = regvalidate ('[0-9]*', '123')

Result

Result = 0.

Example 2

result = regvalidate ('[0-9a-b]*', '12a#4b')

Result

Result = 1 (because # cannot be used, according to the provided regular expression).

 

See also

Regular expressions