|more useful options|
how to measure strictness of a regex ?by didess (Sexton)
|on Jan 23, 2013 at 00:12 UTC||Need Help??|
didess has asked for the
wisdom of the Perl Monks concerning the following question:
Hi Monks !
Do you know some "measure" of how strict a Perl regular expression is ?.
By this I mean the following :
For example, the string ' Daddy' matches /Dad+y/. It matches /D.+/ too.
I hope everyone agrees if I pretend "the first regex is stricter than the second one".
In the need I try to satisfy, I could introduce some limitation in the string's length.
I'm looking for some algorithm or hidden attribute or any good idea translating this "obviousness" into a number, or anything allowing classifying regexes with respect to their "stricness".
Thanks for the help !