So everything between parens gets assigned to variables with a number as the name. They stay available until the next match or substitution. You can read all about it in perlop and perlre.$variable =~ m/;=(\d+);/ print $1; #holds 99 now.
Hope this helps,
Jeroen
"We are not alone"(FZ)
Update: chromatic pointed out to me that it would be good to make the remark that $1 is only set when
the string matches. I totally agree with him.
In reply to Re: Reg ex question
by jeroenes
in thread Reg ex question
by costas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |