This will match both nr\d+ and \d+ and then decide how to replace it based on the presence of "nr".$data =~ s/(nr)?(\d+)/$1 ? "calc($1$2);" : $2 * 4/ge;
In reply to Re: String substitution
by kroach
in thread String substitution
by kepler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |