popy
asked on
adding stuff in string.....
hi all
i have this string :
<li><a href="/anydir/anylink.html ">any text for the link</a>
and i want to get this:
<li><a href="http://www.myserver.com/anydir/anylink.html">any text for the link</a>
do someone have any idea..???
tanks
popy
i have this string :
<li><a href="/anydir/anylink.html
and i want to get this:
<li><a href="http://www.myserver.com/anydir/anylink.html">any text for the link</a>
do someone have any idea..???
tanks
popy
oops
$x = '<li><a href="/anydir/anylink.html ">any text for the link</a>';
$x =~ s#(<a href=")(.*)#$1.'http://www.myserver.com/'.$2#ei;
print $x;
$x = '<li><a href="/anydir/anylink.html
$x =~ s#(<a href=")(.*)#$1.'http://www.myserver.com/'.$2#ei;
print $x;
ASKER
Adjusted points from 100 to 150
ASKER
ok, thanks, but now subquestion, this line appear somewhere in the text, i reading text file, then i need to verifing if the line having this tag...
any sugestion...?
popy
any sugestion...?
popy
There's really no need for the (.*) .$2 and /e
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
while($x = <FILE>){
$num = ($x =~ s#(<a href=")#$1.'http://www.myserver.com/'#gei);
# number of occurences is in $num;
}
$num = ($x =~ s#(<a href=")#$1.'http://www.myserver.com/'#gei);
# number of occurences is in $num;
}
$x =~ s#(<a href=")(.*)#$1.'http://www.myserver.com/'.$2/ei;
print $x;