Why?
I mean it may be a nice exercise, a nice meditation, but what's the use? So Perl::Critic tells you that the regexp on line 1234 of your script is more complex that whatever random treshold someone set. What now? You can add /x, lot's of whitespace and some comments and hope Perl::Critic notices and actually think it's less complex then. Or you can move parts of the regexp into variables and construct the regexp from parts. And again hope Perl::Critic notices and computes the complexity of the stuff that's left on that particular line and not of the completed regexp. Or, you can just turn this off.
In reply to Re: Assessing the complexity of regular expressions
by Jenda
in thread Assessing the complexity of regular expressions
by kyle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |