Bug 249146
Summary: | Regular expression fails in WebKit only: invalid group specifier name | ||
---|---|---|---|
Product: | WebKit | Reporter: | Vladimir Prelovac <vprelovac> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | karlcow, mark.lam, msaboff, webkit-bug-importer |
Priority: | P2 | Keywords: | BrowserCompat, InRadar |
Version: | Safari 16 | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Vladimir Prelovac
The following regular expression works in Chrome and Firefox, but fails in WebKit:
let tokens = "test".match(/(?<=\s+|^)["'‘“'"[({⟨]?(.*?[.?!])(\s[.?!])*["'’”'"\])}⟩]?(?=\s+|$)|(?<=\s+|^)\S(.*?[.?!])(\s[.?!])*(?=\s+|$)/g);
SyntaxError: Invalid regular expression: invalid group specifier name
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/103461779>
Michael Saboff
This was fixed with commit 257823@main (46e6b3f97425): <https://commits.webkit.org/257823@main>.
*** This bug has been marked as a duplicate of bug 174931 ***
Vladimir Prelovac
(In reply to Michael Saboff from comment #2)
> This was fixed with commit 257823@main (46e6b3f97425):
> <https://commits.webkit.org/257823@main>.
>
> *** This bug has been marked as a duplicate of bug 174931 ***
I've compiled trunk with the patch in and want to report that this problem is still not fixed.
Mark Lam
(In reply to Vladimir Prelovac from comment #3)
> > *** This bug has been marked as a duplicate of bug 174931 ***
>
> I've compiled trunk with the patch in and want to report that this problem
> is still not fixed.
Are you sure you're building the latest trunk? I just tried against trunk also, and I also no longer see that SyntaxError. Looks fixed to me.
Vladimir Prelovac
(In reply to Mark Lam from comment #4)
> (In reply to Vladimir Prelovac from comment #3)
> > > *** This bug has been marked as a duplicate of bug 174931 ***
> >
> > I've compiled trunk with the patch in and want to report that this problem
> > is still not fixed.
>
> Are you sure you're building the latest trunk? I just tried against trunk
> also, and I also no longer see that SyntaxError. Looks fixed to me.
Thanks for double checking. I did indeed pull the trunk an hour ago and verified it is latest trunk by verifying the patch was applied. (for example Source/JavaScriptCore/runtime/RegExp.cpp line 252 is " && !pattern.m_containsLookbehinds") The Webkit version also shows as 615.1.15+
Then I went to https://runjs.co (since don't have inspector in minibrowser/run-safari) and ran:
let tokens = "test".match(/(?<=\s+|^)["'‘“'"[({⟨]?(.*?[.?!])(\s[.?!])*["'’”'"\])}⟩]?(?=\s+|$)|(?<=\s+|^)\S(.*?[.?!])(\s[.?!])*(?=\s+|$)/g);
Producing:
SyntaxError: Invalid regular expression: invalid group specifier name
Vladimir Prelovac
My bad, run-minibrowser does not produce error, run-safari does, so I will assume that the problem is on my end. Thanks.