[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / runtime / regex / PerlSyntaxCaveats
1
2 Simple support for Perl-like syntax in GNU Regex:
3
4 If Regex is compiled with PERLSYNTAX #defined, then the following
5 operators can be used in a regexp:
6
7      \s  -- matches whitespace
8      \S  -- matches non-whitespace
9      \w  -- matches alphanumeric (+ '_')
10      \W  -- matches non-alphanumeric
11      \d  -- matches numeric
12      \D  -- matches non-numeric char.
13      \A  -- is equal to beginning-of-buffer operator
14      \Z  -- is the same as end-of-buffer operator
15              
16 Also defined these
17
18      \n  -- matches newline
19      \f  -- matches formfeed
20      \r  -- matches carriage return
21      \t  -- matches (horisontal) tab
22      \v  -- matches a vertical tab
23      \a  -- matches the alarm bell
24      \e  -- matches escape (\033)
25
26
27 Perl5 regexp features not supported
28 ===================================
29
30 * At the moment there is no support for non-greedifying operators such as * by
31   appending a ?, i.e. (pat)*? will not match pat a minimal number of times,
32   * guzzles as many chars as possible.
33
34 * Not possible to quote hex(\xhh) or octal(\ooo) values.
35
36 * No support for \l \L \u \U to force matching of lower or upper case patterns
37   until a \E is seen. (Same goes for \Q to quote metachars.)
38
39 * None of the regexp extension mechanisms of Perl5  (?...) is supported.
40   See perlre for details of what you are missing out on.