It's important to note that regular expression literals are not shared. According to the specification on Regular Expression Literals:
A regular expression literal is an input element that is converted to a RegExp object (see 15.10) each time the literal is evaluated. This means that even if two regular expression literals have identical content, they will never compare as === to each other.
With the introduction of ES5, there was a change in how this behavior worked. Check out what Old ECMAScript 3 had to say about it:
In ECMAScript 3, a regular expression literal is converted to a RegExp object (section 15.10) when it is scanned. The object is created before the containing program or function begins evaluation. Each literal produces a reference to this single object without creating new ones. Even with identical contents, two regular expression literals in a program will not be comparable using ===.
While this approach aimed at sharing compilation results of the regex engine across evaluations, it actually led to some issues, as seen in certain buggy programs.
If you're relying on outdated information, it might be time to consider upgrading to a newer edition of your resources.