Regexes
The Regular Expression engine provided by ParserObjects has fewer features than an ordinary Regular Expression engine, such as the one provided by the System.Text.Regex
class. The following features are supported:
- Literal characters
"abc"
- Basic Quantifiers
- Zero or One
?
- Zero or More
*
- One or More
+
- Zero or One
- Range quantifiers
{3}
exactly three{3,}
at least three{,3}
at most three{3,5}
between three and five
- Groups
( )
- Alternations
|
- Character Classes
[abc]
literal characters[a-cA-C]
character ranges[^abc]
and[^a-c]
inverted ranges
- Built-In Character Classes
\s
and\S
whitespace and non-whitespace\w
and\W
word and non-word\d
and\D
digit and non-digit
$
End anchor
The Regex parser always attempts to match the pattern starting at the current position of the input sequence, and will not look forward to try and match later in the sequence. Because of this, the Regex parser does not support the beginning of input anchor (^
) in patterns. However, it does support the end of input anchor ($
).