Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Regex Problem - alternative searched

by xicheng (Sexton)
on May 18, 2007 at 15:30 UTC ( [id://616218]=note: print w/replies, xml ) Need Help??


in reply to Regex Problem - alternative searched

Hi, I looked at the posts in the link you provided. one of the scenarios looks like exponential explosion when using alternations improperly (metioned in OReilly's book "Mastering Regular Exprssions" by J. Friedl). One of the solutions might be "unfolding" the alternations by using the following pattern:
<!--[^-]*(?:-[^-]+)*-->
which is supposed to be faster than your previous one.

Regards,
Xicheng

Replies are listed 'Best First'.
Re^2: Regex Problem - alternative searched
by Skeeve (Parson) on May 18, 2007 at 15:52 UTC

    That's it! Great! Thanks! It works!

    I guess you mentioned a book I should at least a look at.


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Log In?
Username:
Password:

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

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

    No recent polls found