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

Re: Find Prefix if regex didn't match

by Anonymous Monk
on Oct 31, 2012 at 13:27 UTC ( [id://1001660]=note: print w/replies, xml ) Need Help??


in reply to Find Prefix if regex didn't match

Maybe you're really after m/\G.../gc ? start the next match on the same string where the last match left off?

see Re^2: Help with regular expression, perlfaq6#What good is \G in a regular expression?

Replies are listed 'Best First'.
Re^2: Find Prefix if regex didn't match
by demoralizer (Beadle) on Oct 31, 2012 at 14:33 UTC
    I try to match only once... but to become faster I try to cut unmatchable stuff at the beginning of my search string so that the next try needn't to start from the beginning again.

    At the moment there are some doubts if cutting really makes things better but that is what I see here.

Log In?
Username:
Password:

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

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

    No recent polls found