. . .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.";
In reply to Re: Regex String Matching
by sauoq
in thread Regex String Matching
by Poblachtach32
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |