Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Timeout alarm for regex

by wfsp (Abbot)
on Jul 27, 2006 at 17:09 UTC ( [id://564172]=note: print w/replies, xml ) Need Help??


in reply to Timeout alarm for regex

Can anyone give me a particular regex against a string that would take a long time to complete...
From Progamming Perl:

$_ = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab"; /a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*[b]/;
"... If you remove the "b" from the string the pattern will probably run for many, many years before failing. Many, many millennia. Acutally, billions and billions of years.*"

later

"* Actually, it's more in the order of septillions and septillions. We don't know how long it would take. We didn't care to wait around watching it not fail. In any event, your computer is likely to crash before the heat death of the universe, and this regular expression takes longer than either of those."

Any help? :-)

Apologies to O'Reilly for any infringments.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-24 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found