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 !
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: how to measure strictness of a regex ?
by tobyink (Canon) on Jan 23, 2013 at 00:30 UTC | |
by AnomalousMonk (Archbishop) on Jan 23, 2013 at 01:22 UTC | |
by tobyink (Canon) on Jan 23, 2013 at 07:47 UTC | |
Re: how to measure strictness of a regex ?
by davido (Cardinal) on Jan 23, 2013 at 00:29 UTC | |
Re: how to measure strictness of a regex ?
by LanX (Saint) on Jan 23, 2013 at 07:39 UTC |
Back to
Seekers of Perl Wisdom