Skip to content

Instantly share code, notes, and snippets.

@ycmjason
Created April 16, 2023 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ycmjason/140a058aeda2bfa06d123703540eacb8 to your computer and use it in GitHub Desktop.
Save ycmjason/140a058aeda2bfa06d123703540eacb8 to your computer and use it in GitHub Desktop.
Reasons to hate safari as a frontend developer / Why Safari is the new IE

Reasons to hate safari as a frontend developer / Why Safari is the new IE

This is an on-going list of things that I constantly find missing in Safari, (and possibly ways to work around them)

RegExp Positive/Negative Lookbehind

I cannot believe my eyes when positive/negative lookbehind is still not available on safari. Here is how you can work around it:

Instead of

'abcae'.replaceAll(/(?<=a)./g, '*') // yields 'a*ca*'

We can use $n to put back the matched "lookahead". See more here.

'abcae'.replaceAll(/(a)./g, '$1*') // yields 'a*ca*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment