[doc-en] master: Update pattern.syntax.xml; meta-characters (#3057)
| From: | Mikhail Alferov via GitHub | Date: | Mon, 07 Sep 2026 19:08:35 +0000 |
| Subject: | [doc-en] master: Update pattern.syntax.xml; meta-characters (#3057) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23721@lists.php.net to get a copy of this message | ||
Author: Mikhail Alferov (mmalferov)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-09-07T21:08:33+02:00
Commit: https://github.com/php/doc-en/commit/c414a81646ee424d1814725f54ec86b9a8f6b434
Raw diff: https://github.com/php/doc-en/commit/c414a81646ee424d1814725f54ec86b9a8f6b434.diff
Update pattern.syntax.xml; meta-characters (#3057)
* Update pattern.syntax.xml
* Update pattern.syntax.xml
* Apply suggestions from code review
Co-authored-by: Gina Peter Banyard <girgias@php.net>
* Update pattern.syntax.xml
* Update reference/pcre/pattern.syntax.xml
Co-authored-by: Gina Peter Banyard <girgias@php.net>
* Update reference/pcre/pattern.syntax.xml
Co-authored-by: Gina Peter Banyard <girgias@php.net>
* Update pattern.syntax.xml
* pcre: correct the description of the ? meta-character
A ? used as a quantifier has nothing to do with (, so drop that sentence;
it also repeated the condition of the one following it.
After (, a ? introduces far more than an option setting: non-capturing
groups, named subpatterns, assertions, atomic and conditional groups,
comments and recursion all start with it. Widen the wording accordingly.
An option setting such as (?i) also creates no subpattern of its own.
---------
Co-authored-by: Gina Peter Banyard <girgias@php.net>
Co-authored-by: lacatoire <la.catoire@gmail.com>
Changed paths:
M reference/pcre/pattern.syntax.xml
Diff:
diff --git a/reference/pcre/pattern.syntax.xml b/reference/pcre/pattern.syntax.xml
index d71c8b2c7bb6..98d239fe64df 100644
--- a/reference/pcre/pattern.syntax.xml
+++ b/reference/pcre/pattern.syntax.xml
@@ -160,8 +160,15 @@
<entry>)</entry><entry>end subpattern</entry>
</row>
<row>
- <entry>?</entry><entry>extends the meaning of (, also 0 or 1 quantifier,
also makes greedy
- quantifiers lazy (see <link
linkend="regexp.reference.repetition">repetition</link>)</entry>
+ <entry>?</entry>
+ <entry>
+ Introduces a special construct, such as a non-capturing group, a named
+ subpattern, an assertion or an option setting, if used as the first
+ character after <literal>(</literal>.
+ If used as a quantifier it is the optional quantifier (equivalent to
<literal>{0,1}</literal>).
+ It also transforms greedy quantifiers into lazy quantifiers
+ (see <link linkend="regexp.reference.repetition">repetition</link>).
+ </entry>
</row>
<row>
<entry>*</entry><entry>0 or more quantifier</entry>