Re: Pre-RFC: adding a Regex\CompiledRegex class for compiling regular expressions
| From: | Morgan | Date: | Sun, 27 Sep 2026 00:23:04 +0000 |
| Subject: | Re: Pre-RFC: adding a Regex\CompiledRegex class for compiling regular expressions | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-132661@lists.php.net to get a copy of this message | ||
On 2026-09-26 22:51, Tim Düsterhus wrote:
1. ... possible future additions. Such as methods for constructing a regex algebraically (e.g. an alternatives method taking (objects representing) "a", "b", and "c", and returning "a|b|c").The thing is that all four of those Regex objects will have flags set/unset and it's not immediately clear how the alternation's flags relate to the alternatives' flags. You can already set/unset flags on portions of a regular expression e.g., "/((?i)caseless)|caseful/", so the settings could be retained for the alternatives, but that doesn't say what the settings would be for their combination.