Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Greetings wise and ancient monks of the order of Perl When a regex is run it may take a few steps to match a string, it may back track a little, or it may enter the world of catastrophic backtracking. We have an application where users can create regex patterns to run against a logfile Sometimes the user created patterns stray into the zone of catastrophe, and the servers can spend more CPU trying to match patterns in the logfile than doing real work. I would like a way to pre-validate user's regex against a few hundred sample lines, and ensure that they never enter the world of ridiculous step count. Is there a way to get the regex engine to tell me how many steps it took? Cheers,
Pereant, qui ante nos nostra dixerunt!
In reply to regex step counting by Random_Walk
|
|