You should quote the parts of the replacement you don't want executed:
s/WORD\s(\d+)/"WORD ".(2*$1)/e;
Or, how I'd write it:
- tye (but my friends call me "Tye")s/(WORD\s)(\d+)/$1.(2*$2)/e;
In reply to RE: Re: regex and multiplication
by tye
in thread regex and multiplication
by elwarren
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |