Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: regex hangs forever

by vladdrak (Monk)
on Dec 15, 2006 at 05:10 UTC ( #589980=note: print w/replies, xml ) Need Help??


in reply to regex hangs forever

Try this:
my @content = get("$url$cnt"); while my $beaver (split/href/,@content) { if ($beaver =~ m#/files/images/thumb/ ([a-zA-Z0-9]+\.jpg)#gx) { push(@images, "http://www.imagebeaver.com/files/images/$1:$1"); } }

Replies are listed 'Best First'.
Re^2: regex hangs forever
by Anonymous Monk on Dec 15, 2006 at 05:25 UTC
    /g makes the difference
    C:\>perl -le"print $1 while '1234' =~ /(\d)/g" 1 2 3 4 C:\>

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2023-01-30 18:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?