-
Notifications
You must be signed in to change notification settings - Fork 886
ext/pcre: document variable-length lookbehind and longer subpattern names (PHP 8.4) #5739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1510,6 +1510,10 @@ | |
| also by name. There are two alternative syntaxes | ||
| <literal>(?<name>pattern)</literal> and <literal>(?'name'pattern)</literal>. | ||
| </para> | ||
| <simpara> | ||
| As of PHP 8.4.0, which bundles PCRE2 10.44, the maximum length of a | ||
| subpattern name is 128 characters; prior to PHP 8.4.0 it was 32 characters. | ||
| </simpara> | ||
|
|
||
| <para> | ||
| Sometimes it is necessary to have multiple matching, but alternating | ||
|
|
@@ -1915,6 +1919,14 @@ | |
| at the ends of strings; an example is given at the end | ||
| of the section on once-only subpatterns. | ||
| </para> | ||
| <simpara> | ||
| The fixed-length restriction described above applies prior to PHP 8.4.0. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We shouldn't mention that the behavior described above applies to older versions. Instead, we should move the older behaviour below and state that the current description applies to PHP 8.4.0 and later. The documentation should reflect the latest version by default, whereas behaviour from older versions should be documented separately as historical information. |
||
| As of PHP 8.4.0, which bundles PCRE2 10.44, a lookbehind assertion may match | ||
| strings of variable length: alternatives of differing lengths (such as | ||
| <literal>(?<!dogs?|cats?)</literal>) and top-level branches that can match | ||
| more than one length (such as <literal>(?<=ab(c|de))</literal>) are now | ||
| permitted, up to an implementation-defined maximum length. | ||
| </simpara> | ||
| <para> | ||
| Several assertions (of any sort) may occur in succession. | ||
| For example, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.