You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
More consistent and robust segment wilcard generation #207
Not internally consistent with the full wilcard in handling newline ;
Relying on an obscure regex feature: inverted empty character class or empty character class complement.
Tricky for some current implementation of RegExp v flag.
The proposed change should make the segment wildcard more consistent with the full wildcard and, in passing, be more forgiving for buggy RegExp implementation.
When processing regex pattern for most part of an URL (expect for host and path), the generate a segment wildcard regexp method will be called with the default options for which the delimiter code point in the empty string.
The generated regex string is then [^]+?, an inverted empty character class with lazy matching. It matches every character, including newline, which is slightly different from the full wildcard (matches every character excluding newline).
I would also like to see this standard not rely on the empty character class, as it is a non-standard Regex feature and makes it more difficult to implement this standard in other languages. I implemented URLPattern in Go using your suggested workaround, but now I am concerned whether my implementation is consistent with others.
Activity
matthewdean-semgrep commentedon Jul 25, 2025
I would also like to see this standard not rely on the empty character class, as it is a non-standard Regex feature and makes it more difficult to implement this standard in other languages. I implemented URLPattern in Go using your suggested workaround, but now I am concerned whether my implementation is consistent with others.