Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Eugh, regex :(

by svenXY (Deacon)
on Mar 25, 2009 at 11:43 UTC ( [id://753100]=note: print w/replies, xml ) Need Help??


in reply to Eugh, regex :(

Hi,
works fine for me:
my $post_message = '[URL=http://img207.imageshack.us/my.php?image=dsc0 +3598vt7.jpg][IMG]http://img207.imageshack.us/img207/2964/dsc03598vt7. +jpg[/IMG][/URL]'; print "before: ",$post_message,"\n"; $post_message =~ s#\Q[URL=\E([^]]+)\Q][img]\E([^]]+)\Q[/img][/URL]\E#$ +2#gix; print "after: ",$post_message,"\n";
prints
before: [URL=http://img207.imageshack.us/my.php?image=dsc03598vt7.jpg] +[IMG]http://img207.imageshack.us/img207/2964/dsc03598vt7.jpg[/IMG][/U +RL] after: http://img207.imageshack.us/img207/2964/dsc03598vt7.jpg

Regards,
svenXY

Log In?
Username:
Password:

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

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

    No recent polls found