This method returns a boolean so it should be faster and more memory
efficient.
In order to make this work, I needed to remove the global flag from the
regexes, because that makes the regexes mutable when run multiple times.
Since these are only used to test for any match, and not for any
matching groups or in any other way, we don't need this flag.
This method returns a boolean so it should be faster and more memory efficient.
In order to make this work, I needed to remove the global flag from the regexes, because that makes the regexes mutable when run multiple times. Since these are only used to test for any match, and not for any matching groups or in any other way, we don't need this flag.
cc @ljharb