Extension::RegexGetError Method

Syntax

.GetError as c ()

Description

Get last regular expression operation error. If the operation does not match or return results It may be because there was no match, or there may be an error in the regular expression, GetError() returns a blank string if the regular expression was valid, otherwise it returns the syntax error.

Example

dim re as extension::Regex

? re.split("apples and oranges","([a-z")
= ""
? re.GetError()
= "Unmatched marking parenthesis ( or \(.  The error occurred while parsing the regular expression: '([a-z>>>HERE>>>'."
? re.split("apples and oranges","([a-z]+)")
= apples
and
oranges

See Also