Next | Regular Expression Mastery | 65 |
/(\w+|::)*/
Nested quantifiers are always risky
Whenever you write one, make sure you really need it
To fix this one is easy:
/(\w|::)*/
This is much more efficient --- there aren't so many things to try.
Next | Copyright © 2002 M. J. Dominus |