|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Re: Analysis of Regular Expressionsby Ratazong (Monsignor) |
| on Mar 17, 2010 at 10:04 UTC ( [id://829135]=note: print w/replies, xml ) | Need Help?? |
|
Three possibilities on creating a regex-generality-rating come into my mind:
1. would be easy to implement (generate all strings, match) - but is probably much too slow (just counting the letters and numbers would
give you 26+26+10 different characters at each position of your string ... 2. is more tricky - you need to analyze the regex, but this is possible (see the previous answers, or here for some tools for this.) I would then calculate two ratings for this and combine them in a suitable way (however suitable looks like ;-)
3. If I had the task you describe, I'd first check my possible input-regexes (maybe most of them are just simple?) and check if there is an issue if some are not ordered correctly. Probably it is possible to create a simplified formula that works well in most cases ... HTH, Rata (very interested on how you sort this problem out!)
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||||