=head2 Regular Expressions
+=head3 Metacharacters
+
The patterns used in Perl pattern matching derive from supplied in
the Version 8 regex routines. (The routines are derived
(distantly) from Henry Spencer's freely redistributable reimplementation
the string is a single line--even if it isn't.
X<.> X</s>
+=head3 Quantifiers
+
The following standard quantifiers are recognized:
X<metacharacter> X<quantifier> X<*> X<+> X<?> X<{n}> X<{n,}> X<{n,m}>
as well.
*+ Match 0 or more times and give nothing back
- +? Match 1 or more times and give nothing back
+ ++ Match 1 or more times and give nothing back
?+ Match 0 or 1 time and give nothing back
{n}+ Match exactly n times and give nothing back (redundant)
- {n,}? Match at least n times and give nothing back
- {n,m}? Match at least n but not more than m times and give nothing back
+ {n,}+ Match at least n times and give nothing back
+ {n,m}+ Match at least n but not more than m times and give nothing back
For instance,
/"(?>(?:(?>[^"\\]+)|\\.)*)"/
+=head3 Escape sequences
+
Because patterns are processed as double quoted strings, the following
also work:
X<\t> X<\n> X<\r> X<\f> X<\a> X<\l> X<\u> X<\L> X<\U> X<\E> X<\Q>
while escaping will cause the literal string C<\$> to be matched.
You'll need to write something like C<m/\Quser\E\@\Qhost/>.
+=head3 Character classes
+
In addition, Perl defines the following:
X<metacharacter>
X<\w> X<\W> X<\s> X<\S> X<\d> X<\D> X<\X> X<\p> X<\P> X<\C>
[.cc.] and [=cc=] are recognized but B<not> supported and trying to
use them will cause an error.
+=head3 Assertions
+
Perl defines the following zero-width assertions:
X<zero-width assertion> X<assertion> X<regex, zero-width assertion>
X<regexp, zero-width assertion>
it is recommended that you avoid such usage for now.
X<\G>
+=head3 Capture buffers
+
The bracketing construct C<( ... )> creates capture buffers. To
refer to the digit'th buffer use \<digit> within the
match. Outside the match use "$" instead of "\". (The