pcre2syntax (3) - Linux Manuals
pcre2syntax: Perl-compatible regular expressions (revised API)
NAME
PCRE2 - Perl-compatible regular expressions (revised API)
PCRE2 REGULAR EXPRESSION SYNTAX SUMMARY
The full syntax and semantics of the regular expressions that are supported by PCRE2 are described in the pcre2pattern documentation. This document contains a quick-reference summary of the syntax.
QUOTING
This table applies to ASCII and Unicode environments. An unrecognized escape
sequence causes an error.
If PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX is set ("ALT_BSUX mode"), the
following are also recognized:
When \x is not followed by {, from zero to two hexadecimal digits are read,
but in ALT_BSUX mode \x must be followed by two hexadecimal digits to be
recognized as a hexadecimal escape; otherwise it matches a literal "x".
Likewise, if \u (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".
Note that \0dd is always an octal code. The treatment of backslash followed by
a non-zero digit is complicated; for details see the section
"Non-printing characters"
in the
pcre2pattern
documentation, where details of escape processing in EBCDIC environments are
also given. \N{U+hh..} is synonymous with \x{hh..} in PCRE2 but is not
supported in EBCDIC environments. Note that \N not followed by an opening
curly bracket has a different meaning (see below).
ESCAPED CHARACTERS
CHARACTER TYPES