my $stuff = qq^
here is some stuff
and more stuff to boot
stuff for me
and stuff for you
^;
$stuff =~ s/stuff/money/gs; 
# g says match all occurrences
# s says treat $stuff as a single line

Regards,
David



----- Original Message ----- 
From: "Octavian Rasnita" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 28, 2002 9:57 AM
Subject: Help! which are the correct parameters?


Hi all,

I want to use regular expressions to match all the links from a web page.
I am fighting for a long time but with no results.
I don't know what modifiers I need to use for matching all the links even
though some of them use multiple lines.

I want to also match a link like:

<a href=http://www.server.com/dir/file.shtml
title="Test link">
This is a test only
</a>

Without the /m modifyer, my regexp matches only the first link that is on a
single line.
With the /m modifyer, the regexp matches all the links that  don't span on
multiple lines.

But the links that span on multiple lines  can't be matched.

I've tried the following regexp:

$link =~ s/(<a href=".*">)/<a
href="http\:\/\/MyServer\.com\/cgi-bin\/script\.pl\?page=$1">/mgi;


Thank you for any idea.

Teddy Center: http://teddy.fcc.ro/
Mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to