Thanks to modern browsers, writing cross-browser compatible JavaScript isn’t nearly as difficult as it was even just a few years ago; however, there are still times when you get cryptic error messages such as “invalid regular expression flag.”
Just as Jamie Zawinski said:
Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems.
It’s funny because it’s true, right? But we still have regular expressions, they’re still powerful, and we still use them.
Unfortunately, there are still times in which they can plague us when working with JavaScript, string replacement, and modern web browsers.