Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: regex step counting

by LanX (Saint)
on Dec 03, 2019 at 22:21 UTC ( [id://11109632]=note: print w/replies, xml ) Need Help??


in reply to Re^2: regex step counting
in thread regex step counting

> not Perl, but a very limited subset of Java's regex

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11109632]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-24 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found