aboutsummaryrefslogtreecommitdiff
path: root/dist2/doc/pcre2syntax.3
diff options
context:
space:
mode:
Diffstat (limited to 'dist2/doc/pcre2syntax.3')
-rw-r--r--dist2/doc/pcre2syntax.3113
1 files changed, 40 insertions, 73 deletions
diff --git a/dist2/doc/pcre2syntax.3 b/dist2/doc/pcre2syntax.3
index 70538e4e..c392bfb0 100644
--- a/dist2/doc/pcre2syntax.3
+++ b/dist2/doc/pcre2syntax.3
@@ -1,4 +1,4 @@
-.TH PCRE2SYNTAX 3 "11 February 2019" "PCRE2 10.33"
+.TH PCRE2SYNTAX 3 "02 September 2018" "PCRE2 10.32"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.SH "PCRE2 REGULAR EXPRESSION SYNTAX SUMMARY"
@@ -22,8 +22,7 @@ documentation. This document contains a quick-reference summary of the syntax.
.SH "ESCAPED CHARACTERS"
.rs
.sp
-This table applies to ASCII and Unicode environments. An unrecognized escape
-sequence causes an error.
+This table applies to ASCII and Unicode environments.
.sp
\ea alarm, that is, the BEL character (hex 07)
\ecx "control-x", where x is any ASCII printing character
@@ -35,24 +34,12 @@ sequence causes an error.
\e0dd character with octal code 0dd
\eddd character with octal code ddd, or backreference
\eo{ddd..} character with octal code ddd..
+ \eU "U" if PCRE2_ALT_BSUX is set (otherwise is an error)
\eN{U+hh..} character with Unicode code point hh.. (Unicode mode only)
+ \euhhhh character with hex code hhhh (if PCRE2_ALT_BSUX is set)
\exhh character with hex code hh
\ex{hh..} character with hex code hh..
.sp
-If PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX is set ("ALT_BSUX mode"), the
-following are also recognized:
-.sp
- \eU the character "U"
- \euhhhh character with hex code hhhh
- \eu{hh..} character with hex code hh.. but only for EXTRA_ALT_BSUX
-.sp
-When \ex is not followed by {, from zero to two hexadecimal digits are read,
-but in ALT_BSUX mode \ex must be followed by two hexadecimal digits to be
-recognized as a hexadecimal escape; otherwise it matches a literal "x".
-Likewise, if \eu (in ALT_BSUX mode) is not followed by four hexadecimal digits
-or (in EXTRA_ALT_BSUX mode) a sequence of hex digits in curly brackets, it
-matches a literal "u".
-.P
Note that \e0dd is always an octal code. The treatment of backslash followed by
a non-zero digit is complicated; for details see the section
.\" HTML <a href="pcre2pattern.html#digitsafterbackslash">
@@ -67,6 +54,12 @@ documentation, where details of escape processing in EBCDIC environments are
also given. \eN{U+hh..} is synonymous with \ex{hh..} in PCRE2 but is not
supported in EBCDIC environments. Note that \eN not followed by an opening
curly bracket has a different meaning (see below).
+.P
+When \ex is not followed by {, from zero to two hexadecimal digits are read,
+but if PCRE2_ALT_BSUX is set, \ex must be followed by two hexadecimal digits to
+be recognized as a hexadecimal escape; otherwise it matches a literal "x".
+Likewise, if \eu (in ALT_BSUX mode) is not followed by four hexadecimal digits,
+it matches a literal "u".
.
.
.SH "CHARACTER TYPES"
@@ -405,24 +398,19 @@ but some of them use Unicode properties if PCRE2_UCP is set. You can use
.SH "CAPTURING"
.rs
.sp
- (...) capture group
- (?<name>...) named capture group (Perl)
- (?'name'...) named capture group (Perl)
- (?P<name>...) named capture group (Python)
- (?:...) non-capture group
- (?|...) non-capture group; reset group numbers for
- capture groups in each alternative
-.sp
-In non-UTF modes, names may contain underscores and ASCII letters and digits;
-in UTF modes, any Unicode letters and Unicode decimal digits are permitted. In
-both cases, a name must not start with a digit.
+ (...) capturing group
+ (?<name>...) named capturing group (Perl)
+ (?'name'...) named capturing group (Perl)
+ (?P<name>...) named capturing group (Python)
+ (?:...) non-capturing group
+ (?|...) non-capturing group; reset group numbers for
+ capturing groups in each alternative
.
.
.SH "ATOMIC GROUPS"
.rs
.sp
- (?>...) atomic non-capture group
- (*atomic:...) atomic non-capture group
+ (?>...) atomic, non-capturing group
.
.
.SH "COMMENT"
@@ -450,7 +438,7 @@ of the group.
Unsetting x or xx unsets both. Several options may be set at once, and a
mixture of setting and unsetting such as (?i-x) is allowed, but there may be
only one hyphen. Setting (but no unsetting) is allowed after (?^ for example
-(?^in). An option setting may appear at the start of a non-capture group, for
+(?^in). An option setting may appear at the start of a non-capturing group, for
example (?i:...).
.P
The following are recognized only at the very start of a pattern or after one
@@ -503,33 +491,12 @@ setting with a similar syntax.
.SH "LOOKAHEAD AND LOOKBEHIND ASSERTIONS"
.rs
.sp
- (?=...) )
- (*pla:...) ) positive lookahead
- (*positive_lookahead:...) )
-.sp
- (?!...) )
- (*nla:...) ) negative lookahead
- (*negative_lookahead:...) )
-.sp
- (?<=...) )
- (*plb:...) ) positive lookbehind
- (*positive_lookbehind:...) )
-.sp
- (?<!...) )
- (*nlb:...) ) negative lookbehind
- (*negative_lookbehind:...) )
-.sp
-Each top-level branch of a lookbehind must be of a fixed length.
-.
-.
-.SH "SCRIPT RUNS"
-.rs
-.sp
- (*script_run:...) ) script run, can be backtracked into
- (*sr:...) )
+ (?=...) positive look ahead
+ (?!...) negative look ahead
+ (?<=...) positive look behind
+ (?<!...) negative look behind
.sp
- (*atomic_script_run:...) ) atomic script run
- (*asr:...) )
+Each top-level branch of a look behind must be of a fixed length.
.
.
.SH "BACKREFERENCES"
@@ -553,19 +520,19 @@ Each top-level branch of a lookbehind must be of a fixed length.
.rs
.sp
(?R) recurse whole pattern
- (?n) call subroutine by absolute number
- (?+n) call subroutine by relative number
- (?-n) call subroutine by relative number
- (?&name) call subroutine by name (Perl)
- (?P>name) call subroutine by name (Python)
- \eg<name> call subroutine by name (Oniguruma)
- \eg'name' call subroutine by name (Oniguruma)
- \eg<n> call subroutine by absolute number (Oniguruma)
- \eg'n' call subroutine by absolute number (Oniguruma)
- \eg<+n> call subroutine by relative number (PCRE2 extension)
- \eg'+n' call subroutine by relative number (PCRE2 extension)
- \eg<-n> call subroutine by relative number (PCRE2 extension)
- \eg'-n' call subroutine by relative number (PCRE2 extension)
+ (?n) call subpattern by absolute number
+ (?+n) call subpattern by relative number
+ (?-n) call subpattern by relative number
+ (?&name) call subpattern by name (Perl)
+ (?P>name) call subpattern by name (Python)
+ \eg<name> call subpattern by name (Oniguruma)
+ \eg'name' call subpattern by name (Oniguruma)
+ \eg<n> call subpattern by absolute number (Oniguruma)
+ \eg'n' call subpattern by absolute number (Oniguruma)
+ \eg<+n> call subpattern by relative number (PCRE2 extension)
+ \eg'+n' call subpattern by relative number (PCRE2 extension)
+ \eg<-n> call subpattern by relative number (PCRE2 extension)
+ \eg'-n' call subpattern by relative number (PCRE2 extension)
.
.
.SH "CONDITIONAL PATTERNS"
@@ -583,7 +550,7 @@ Each top-level branch of a lookbehind must be of a fixed length.
(?(R) overall recursion condition
(?(Rn) specific numbered group recursion condition
(?(R&name) specific named group recursion condition
- (?(DEFINE) define groups for reference
+ (?(DEFINE) define subpattern for reference
(?(VERSION[>]=n.m) test PCRE2 version
(?(assert) assertion condition
.sp
@@ -654,6 +621,6 @@ Cambridge, England.
.rs
.sp
.nf
-Last updated: 11 February 2019
-Copyright (c) 1997-2019 University of Cambridge.
+Last updated: 02 September 2018
+Copyright (c) 1997-2018 University of Cambridge.
.fi