We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cadfa5c commit 24a00b6Copy full SHA for 24a00b6
src/Type/Regex/RegexGroupParser.php
@@ -72,12 +72,9 @@ public function parseGroups(string $regex): ?array
72
}
73
74
75
- // The regex engine ignores everything after the (?# until the first closing parenthesis
76
- $regex = preg_replace('/\(\?#[^)]*\)/', '', $regex) ?? '';
77
-
78
if (str_contains($modifiers, 'x')) {
79
// in freespacing mode the # character starts a comment and runs until the end of the line
80
- $regex = preg_replace('/#.*/', '', $regex) ?? '';
+ $regex = preg_replace('/[^?]#.*/', '', $regex) ?? '';
81
82
83
$rawRegex = $this->regexExpressionHelper->removeDelimitersAndModifiers($regex);
0 commit comments