In all the examples I see, the number of characters that fail to match \w is a good measure of complexity. If you added s/\w+/x/g to the end of your massaging, I think you would get much better results. For example, I consider /[-+=:;"&*'#^`<>]/ quite a bit more complicated than /[qetuoljgdaxvnm]/ even though both are attempting to match a collection of literals. At first glance you fear that the first may do more than it does. Moreover if you were to attempt to add things to this class, you may need to be careful (position of characters matters, some chars need to be escaped). This also solves your long variable name problem.
Good Day,
Dean
In reply to Re: Assessing the complexity of regular expressions
by duelafn
in thread Assessing the complexity of regular expressions
by kyle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |