Bug 174931

Summary: Implement RegExp lookbehind assertions
Product: WebKit Reporter: Mathias Bynens <mathias>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: ASSIGNED ---    
Severity: Normal CC: eddieloeffen, fpizlo, glen.84, hello, james, keith_miller, l.pmd, mark.lam, mathias, md331, me, m.heilemann, msaboff, myakura.web, naktinis, pnormand, simonlampen, steffen.weber, thatcomputerguy0101, tobiasuhlig78, vertigoback, webkit-bug-importer, webkit, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://github.com/tc39/proposal-regexp-lookbehind

Description Mathias Bynens 2017-07-28 00:44:39 PDT
https://github.com/tc39/proposal-regexp-lookbehind
Comment 1 Radar WebKit Bug Importer 2017-07-29 11:45:21 PDT
<rdar://problem/33608833>
Comment 2 Michael Saboff 2017-07-31 15:10:29 PDT
<rdar://problem/33183185>
Comment 3 Masataka Yakura 2020-04-10 09:22:20 PDT
it looks like devs started to use it in the wild without fallback :(

steamcommunity.com - Page doesn't load after signing into Steam account · Issue #51385 · webcompat/web-bugs
https://github.com/webcompat/web-bugs/issues/51385
Comment 4 md331 2020-06-04 06:50:02 PDT
ES2018 regex has landed in the beta channel of FF (https://bugzilla.mozilla.org/show_bug.cgi?id=1225665) due out end of June 2020. That'll mean Chrome, Edge, and FF support it but Safari still does not.
Comment 5 Tobias Uhlig 2021-06-19 14:01:49 PDT
I actually used it for a neo.mjs viewmodel regex and just got a heads up that dist/prod builds no longer work in safari due to this =/

Well, at first I got a report "breaks on mobile" => did not get a JS error inside my remote debugging tools, but luckily it is reproducable on desktop.

Adding this feature would be highly appreciated!

Thanks,
Tobias
Comment 6 James Livesey 2021-06-20 05:44:22 PDT
As somebody who uses lookbehind in regex for a lot of my code, I would like to show my strong support for the resolution of this issue. Considering that all modern browsers -- save for Safari/WebKit -- support regex lookbehind, as a web developer, I find it frustrating that WebKit is the only modern browser engine which does not support this.

Which, at the moment, means that I unfortunately must resort to excluding those who use Safari/WebKit browsers from accessing some of my projects, and by extension, those who use iOS/iPadOS devices too (since the use of WebKit in any web browser is unfortunately mandatory).

From the report date, this issue has been around since 2017, so it is coming up to the 4-year anniversary of this issue existing, as of the time of writing. I hope that by giving my remarks on this issue, the WebKit developers take notice and implement this feature which really should have been added in some time ago.

According to earlier comments, it seems that many major platforms have used regex lookbehind, which completely renders sites unusable for iOS users. Though I am not an iOS, iPadOS or macOS user myself (in part because of my views on Apple's App Store browser engine policy), I would like to see this change so that iOS/iPadOS users in particular can enjoy not just my services, but others' services too.

If this issue is being worked on as we speak, I would like to therefore thank the WebKit developers in doing so.
Comment 7 Alexey Shvayka 2021-07-23 16:58:45 PDT
*** Bug 226465 has been marked as a duplicate of this bug. ***
Comment 8 Marvin 2021-07-29 00:17:58 PDT
Can this be given a higher priority? All major browser except Safari support it and it has been opened for four years now...

I want to use negative lookbehinds in our Ionic app which uses WKWebView. This would really reduce some complicated Regex.
Comment 9 Simon Lampen 2021-08-18 19:58:26 PDT
Yes I agree, it would be great if be brought inline with all the other current evergreen browsers and also to the up coming spec too.
Comment 10 VLang 2021-08-31 02:39:00 PDT
I've been tracking this one for years and I'm finally throwing a comment in here in the hope it gets bumped in priority.

Due to the fact that Apple products force all browsers to use JavaScriptCore, this means that Lookbehinds still won't wont work on *most* browsers in the United States. It actually means that less Americans can use apps with Lookbehinds than can people in countries with lower GDPs (due to Apple products being more expensive)!
Comment 11 VLang 2021-09-04 14:58:59 PDT
To anyone tracking this, I emailed the Assignee of this bug and he said "We plan on getting to it in the next couple of months."

Fingers crossed
Comment 12 James Livesey 2021-09-05 04:52:30 PDT
Brilliant news if that's the case! Certainly keeping my fingers crossed. It'll be great to hear an ETA for when this will be released -- I personally do not know the time it takes to implement such a feature, but I doubt it should take too long imo. That's just my naïve estimation though!