diff options
Diffstat (limited to 'ghc/runtime/regex/PerlSyntaxCaveats')
-rw-r--r-- | ghc/runtime/regex/PerlSyntaxCaveats | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ghc/runtime/regex/PerlSyntaxCaveats b/ghc/runtime/regex/PerlSyntaxCaveats new file mode 100644 index 0000000000..bd66c14f73 --- /dev/null +++ b/ghc/runtime/regex/PerlSyntaxCaveats @@ -0,0 +1,40 @@ + +Simple support for Perl-like syntax in GNU Regex: + +If Regex is compiled with PERLSYNTAX #defined, then the following +operators can be used in a regexp: + + \s -- matches whitespace + \S -- matches non-whitespace + \w -- matches alphanumeric (+ '_') + \W -- matches non-alphanumeric + \d -- matches numeric + \D -- matches non-numeric char. + \A -- is equal to beginning-of-buffer operator + \Z -- is the same as end-of-buffer operator + +Also defined these + + \n -- matches newline + \f -- matches formfeed + \r -- matches carriage return + \t -- matches (horisontal) tab + \v -- matches a vertical tab + \a -- matches the alarm bell + \e -- matches escape (\033) + + +Perl5 regexp features not supported +=================================== + +* At the moment there is no support for non-greedifying operators such as * by + appending a ?, i.e. (pat)*? will not match pat a minimal number of times, + * guzzles as many chars as possible. + +* Not possible to quote hex(\xhh) or octal(\ooo) values. + +* No support for \l \L \u \U to force matching of lower or upper case patterns + until a \E is seen. (Same goes for \Q to quote metachars.) + +* None of the regexp extension mechanisms of Perl5 (?...) is supported. + See perlre for details of what you are missing out on. |