in reply to Regexp problem
Your regexp asks for:
and gets rid of them. What matches in your string is in bold: &frame=content. Can you see why?the literal string "frame=" followed by ONE character from a character class containing alphanumer +ics and the underscore AND an asterisk! followed by the ampersand repeated zero or one times
I think you want something like this: $print_link =~ s/frame=(\w*)&*?/$1/; This looks for your "frame=", saves all word characters, looks for 0 or more ampersands non-greedily, and substitutes just the saved alphanumerics for the whole thing.
If you were to use CGI.pm -- and you probably should -- you could do: my $frame = $q->param("frame");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Regexp problem
by btrott (Parson) on Apr 18, 2000 at 21:39 UTC | |
by chromatic (Archbishop) on Apr 18, 2000 at 22:33 UTC | |
by Maclir (Curate) on Apr 19, 2000 at 01:39 UTC |