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
<rdar://problem/103461779>
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 ***
(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.
(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.
(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
My bad, run-minibrowser does not produce error, run-safari does, so I will assume that the problem is on my end. Thanks.