Stefan Lidman wrote:
> Francesco del Vecchio wrote:
> >
> > I have this string:
> >
> > </td><td width=3 background="img/colore_grigio.gif"><img
> > src="img/colore_grigio.gif" width=1 height=1></td></table>
> >
> > I would like to replace the background adding the absolutepath. So
> > I write this code
> >
> > $tosubstitute = url($4,$baseurl)->abs->as_string;
>
> > $tosubstitute =qq($tosubstitute);
> > $line =~
> > s{background(\s?)(=?)(\"?)(.*?)(\"?)\s}{background=$tosubstitute
> > }i;
>
> change those two lines to:
>
> $line =~ s{background\s?=".*?"}{background=$to_substitute}i;
>
> and it should work. You dont have a \s after the "
>
> /Stefan
>
> > checking the $tosubstitute variable it's value is correct...but I
> > obtain this
> >
> > </td><td width=3
> > background=http://www.html.it/img/colore_grigio.gif%22%3E%3Cimg
> > src="img/colore_grigio.gif" width=1 height=1></td></table>
> >
> > note that this strange chars (%22%3E%3Cimg) have appeared. What can
> > I do to make it work?

These characters are either already in your $to_substitute variable
or they are a result of something done between the substitution and
examining $line for the result. This happens to be the URI escaped
version of

    "><img

which exists in your original string.

Rob





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

Reply via email to