Последовательность между \Q и \E должна восприниматься "как есть"

Issue #87 closed
Oleg Sychev repo owner created an issue

Originally reported on Google Code with ID 87 ``` If you want to remove the special meaning from a sequence of charac ters, you can do so by putting them between \Q and \E. This is differ ent from Perl in that $ and @ are handled as literals in \Q...\E sequences in PCRE, whereas in Perl, $ and @ cause variable interpola tion. Note the following examples:

Pattern PCRE matches Perl matches

\Qabc$xyz\E abc$xyz abc followed by the contents of $xyz \Qabc\$xyz\E abc\$xyz abc\$xyz \Qabc\E\$\Qxyz\E abc$xyz abc$xyz

The \Q...\E sequence is recognized both inside and outside character classes. An isolated \E that is not preceded by \Q is ignored. If \Q is not followed by \E later in the pattern, the literal interpretation continues to the end of the pattern (that is, \E is assumed at the end). If the isolated \Q is inside a character class, this causes an error, because the character class is not terminated. ```

Reported by `oasychev` on 2012-01-02 22:03:37

Comments (2)

  1. Log in to comment