Perl-совместимые регулярные выражения (Perl-compatible regular expressions)
PCRE REGULAR EXPRESSION DETAILS
The syntax and semantics of the regular expressions that are
supported by PCRE are described in detail below. There is a
quick-reference syntax summary in the pcresyntax
page. PCRE tries
to match Perl syntax and semantics as closely as it can. PCRE
also supports some alternative regular expression syntax (which
does not conflict with the Perl syntax) in order to provide some
compatibility with regular expressions in Python, .NET, and
Oniguruma.
Perl's regular expressions are described in its own
documentation, and regular expressions in general are covered in
a number of books, some of which have copious examples. Jeffrey
Friedl's "Mastering Regular Expressions", published by O'Reilly,
covers regular expressions in great detail. This description of
PCRE's regular expressions is intended as reference material.
This document discusses the patterns that are supported by PCRE
when one its main matching functions, pcre_exec()
(8-bit) or
pcre[16|32]_exec()
(16- or 32-bit), is used. PCRE also has
alternative matching functions, pcre_dfa_exec()
and
pcre[16|32_dfa_exec()
, which match using a different algorithm
that is not Perl-compatible. Some of the features discussed below
are not available when DFA matching is used. The advantages and
disadvantages of the alternative functions, and how they differ
from the normal functions, are discussed in the pcrematching
page.