Never use $2 without checking the success of the prior match. If the match fails, you'll get a previous $2, which could even lead to security holes./^(\w+) (\w+)\;/; print $2;
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to Re: Regular Expression
by merlyn
in thread Regular Expression
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |