[Webkit-unassigned] [Bug 272659] New: Nested duplicate named capturing groups in regex is not syntax error

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 15 00:05:51 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=272659

            Bug ID: 272659
           Summary: Nested duplicate named capturing groups in regex is
                    not syntax error
           Product: WebKit
           Version: Safari 17
          Hardware: Mac (Apple Silicon)
                OS: macOS 14
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: y.ohta.z3 at future.co.jp

When I run the following two regexes in Safari's JavaScript console, one gives a syntax error, but the other does not:

But I expected both to result in a syntax error.

```js
/(?:(?<x>a)|(?<x>b))(?<x>c)/; // not syntax error?
/(?<x>c)(?:(?<x>a)|(?<x>b))/; // syntax error
```

I think they should both be syntax errors, since they're just swapped around. What do you think?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240415/39409127/attachment.htm>


More information about the webkit-unassigned mailing list