in reply to Substitution Problem
try@links1="<a href=\"www\.testurl\.com\">"; @links1=~s/.*/href\s*\=\s*\".*?\"/is;
You're escaping more than you need to in the regex, and you're not capturing the the left-hand side the subset of the string that you want to make the replacement with on the right-hand side.$links1 = '<a href="www.testurl.com">'; $links1 =~ s/<a\s+(href=".*?")\s*>/$1/is;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Substitution Problem
by Wassercrats (Initiate) on Sep 10, 2002 at 05:01 UTC | |
by Django (Pilgrim) on Sep 10, 2002 at 08:05 UTC | |
by Wassercrats (Initiate) on Sep 13, 2002 at 02:42 UTC | |
by Django (Pilgrim) on Sep 13, 2002 at 07:25 UTC | |
by Wassercrats (Initiate) on Sep 13, 2002 at 08:07 UTC | |
by Wassercrats (Initiate) on Sep 10, 2002 at 05:10 UTC | |
by bart (Canon) on Sep 10, 2002 at 07:16 UTC |