in reply to Re: Regexp problem
in thread Regexp problem
I don't think this is right, particularly the bit about the character class. Within a character class definition ("[]"), an asterick matches an asterick--it doesn't have a meta-meaning within a character class. So what that character class actually matches is alphanumerics, the underscore, and an asterick. And it matches it *one time*-- not zero, not more than 1.> the literal string "frame=" > followed by a character class containing alphanumerics and the under +score > repeated zero or more times > ...
That's why just the "c" from "content" got included-- because the character class swipes up one character.
As an example, take a look at this:
This prints outmy $print_link = "http://www.foo.com/bar?method=go&frame=*content&name +=baz"; $print_link =~ s/frame=[\w*]&*//; print $print_link, "\n";
So the regex matched "frame=*".http://www.foo.com/bar?method=go&content&name=baz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: Re: Regexp problem
by chromatic (Archbishop) on Apr 18, 2000 at 22:33 UTC | |
|
RE: RE: Re: Regexp problem
by Maclir (Curate) on Apr 19, 2000 at 01:39 UTC |