dsb has asked for the wisdom of the Perl Monks concerning the following question:
This is just a possible method to keeping track of the links. The problem is that one of the links in the source for the page has a '+' in it. I get a "nested *?+" error when I run the script because of it. I would just escape it in the regex but the value is held in a scalar. I tried to substitute all +'s with an escaped plus but that didn't work. It just substitutes with another '+'(the backslash apparently doesn't show in the string).while ( $src =~ m%<a href="([^"]+)"(?:.|\n)*?>([^>]+)</a>%g ) { $inf->{$i} = { 'url' => $1, 'res' => $2 }; $s_text = $2; $n_src =~ s%$s_text%[$i $s_text]%; $i++; }
I'm out of ideas with this one. Any help would be great.
Amel - f.k.a. - kel
2001-03-04 Edit by Corion : Changed title
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex Question
by japhy (Canon) on Mar 03, 2001 at 00:57 UTC | |
|
Re: Regex Question
by Anonymous Monk on Mar 03, 2001 at 01:09 UTC |