in reply to Regex String Matching
. . .I get a runtime error saying that $1 is uninitailised.
You need to use parentheses to capture the match.
$str =~ /str=([a-zA-Z]+)/Since you mention you want everything up to the next '&' you might be better off with a regex that does what you mean:
$str =~ /str=([^&]*)/-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re(2) Regex String Matching
by Arien (Pilgrim) on Sep 09, 2002 at 04:55 UTC |