rakun icon indicating copy to clipboard operation
rakun copied to clipboard

Make regex Safari and iOS compliant.

Open Wamy-Dev opened this issue 2 years ago • 3 comments

Describe the bug Some of your regex's are not safari and iOS compliant. When testing on an iOS device (iPhone 12 Pro on Chrome and Safari), I get a blank screen (when developing for rakun.app). This happens in production as well. Same thing happens when you use rakun.parse in a Safari browser.

SyntaxError: Invalid regular expression: invalid group specifier name That is the error I get when testing in a Safari browser (Macbook Air).

To Reproduce rakun.parse on any Safari browser and iOS device.

Expected behavior Regex should complete and retrieve the significant data.

Additional context Maybe relevant fixes for it. I haven't looked too deeply into all this as I don't know much of anything about regex.

  • https://stackoverflow.com/questions/56926806/how-to-make-this-regex-safari-ios-compliant
  • https://stackoverflow.com/questions/64410005/equivalent-regex-unsupported-lookbehind-assertion-ios-safari

Wamy-Dev avatar Jun 25 '22 05:06 Wamy-Dev

I have no specifics as safari debugging is terrible, so sorry about that. I have no idea which regex functions they are, I just know something is broken.

Wamy-Dev avatar Jun 25 '22 05:06 Wamy-Dev

Yeah I'm pretty sure it's linked to regexp lookbehind which are still not supported by safari... https://caniuse.com/js-regexp-lookbehind But it should be eventually supported one day I guess

From what I've check a lot of regexs used are using the look-behind feature, so it may be a bit hard to rewrite them to make it work 😕

This module was mostly intended to be used in a backend environement (with nodeJS) so I guess the fix would be to use a server instead that responds the requests, though it's a bit a shame since it seems to works locally for most browsers

lowlighter avatar Jun 26 '22 15:06 lowlighter

Ah so it's not really gonna be fixed. Thats okay, I'll just write an error for anyone who visits on those devices. Kind of a shame but I understand.

Wamy-Dev avatar Jun 26 '22 18:06 Wamy-Dev