[php-src] PR #12004: gen_stub: fix regexps with unintentional range due to `-` character placement
| From: | Ayesh | Date: | Sun, 20 Aug 2023 05:58:57 +0000 |
| Subject: | [php-src] PR #12004: gen_stub: fix regexps with unintentional range due to `-` character placement | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-23418@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/12004
Author: Ayesh
[A-Za-z0-9_-|] regex range is interpreted as any character in ranges A-Z,
a-z, 0-9, and _-|. The last three characters
(_-|) are interpretted as a range, because the dash character is placed between
_ and |. This means the regexp matches any ASCII character between ASCII
index 95 and 124. This means that this expression unexpectedly (?) matches characters such as
\ and {`
This changes the regexp to place the dash character at the end, so instead of any character in ASCII
95-124, it only matches -, |, and _ characters only.

Regex101 also highlighting this: https://regex101.com/r/gEq3wc/1