Because in perl's regular expression language parens have meaning, they're meta characters, specifically, they're called capturing parens. Anything matched in capturing parens, is stored in a number variable ($1,$2 ...)
To see how the regex engine does matching, use re 'debug';
In reply to Re: Parens mess up regex substitute
by Anonymous Monk
in thread Parens mess up regex substitute
by BenHopkins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |