in reply to Re^2: regex step counting
in thread regex step counting
I was afraid you'd say this, different engines do different guessing and optimizations.
Something very fast in Perl can be a nightmare elsewhere, and vice versa.
> I don't really need 100% accurate count of how many steps they are taking, just an idea if they are in the region of up to a few hundred steps per line
It really depends on how limited your grammar is.
The point why I mentioned the halting problem is, that the proof shows a way to construct a pathological case for every approach.
In other words, if your tests are limited it's possible to construct a troublesome regex which will pass them. (Provided the grammar is rich enough)°
Hence no guaranties whatsoever!
Good luck! :)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
°) actually it's pretty trivially done, if the regex has no length restriction.
|
---|