Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: regex hangs forever

by vladdrak (Monk)
on Dec 15, 2006 at 05:10 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-20 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found