[doc-en] master: Add \Q, \E and \K to the PCRE escape sequences (#5964)
| From: | qodelicious via GitHub | Date: | Mon, 19 Oct 2026 08:50:28 +0000 |
| Subject: | [doc-en] master: Add \Q, \E and \K to the PCRE escape sequences (#5964) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23859@lists.php.net to get a copy of this message | ||
Author: qodelicious (qodelicious)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-10-19T10:50:25+02:00
Commit: https://github.com/php/doc-en/commit/75a5eb81be58ce50889c429c5d32b321af016d23
Raw diff: https://github.com/php/doc-en/commit/75a5eb81be58ce50889c429c5d32b321af016d23.diff
Add \Q, \E and \K to the PCRE escape sequences (#5964)
* Add \Q, \E and \K to the PCRE escape sequences
Fixes #4623
* Use simpara for the sequences intro
Changed paths:
M reference/pcre/pattern.syntax.xml
Diff:
diff --git a/reference/pcre/pattern.syntax.xml b/reference/pcre/pattern.syntax.xml
index 98d239fe64df..473459a7f938 100644
--- a/reference/pcre/pattern.syntax.xml
+++ b/reference/pcre/pattern.syntax.xml
@@ -610,6 +610,25 @@
<function>preg_match</function>. It differs from <literal>\A</literal>
when the value of <parameter>offset</parameter> is non-zero.
</para>
+ <simpara>
+ Backslash is also used for the following sequences:
+ </simpara>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><emphasis>\Q</emphasis></term>
+ <listitem><simpara>start of a quoted sequence, metacharacters up to
<literal>\E</literal> are treated as literals</simpara></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><emphasis>\E</emphasis></term>
+ <listitem><simpara>end of a quoted sequence started by
<literal>\Q</literal></simpara></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><emphasis>\K</emphasis></term>
+ <listitem><simpara>reset the start of the reported
match</simpara></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
<para>
<literal>\Q</literal> and <literal>\E</literal> can be used to ignore