in reply to Re: Re: Re: Re: Substitution Problem
in thread Substitution Problem
That wouldn't make much sense, because a character class can match any of its characters, but how should it be interpreted in the right side of s///? Should that mean all the characters it represents? Or a random one?
The following code does what you want:
Now let me explain your errors:for (@links1) { s/<\s*a\s.*?\b(href\s*=\s*".*?").*?>/<a $1>/i; }
@links1=~ # that would work like scalar(@array)=~ s/ .* # replace complete string with / href # 'href' \s* # as many spacey chars as possible \= # no need to escape '=' \s* # as many spacey chars as possible \" # no need to escape '"' .*? # as few as possible (=no) anythings \" # no need to escape '"' /isx; # 's' is not needed, I added 'x'
~Django
"Why don't we ever challenge the spherical earth theory?"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Re: Substitution Problem
by Wassercrats (Initiate) on Sep 13, 2002 at 08:07 UTC |