with the result:$x = '123'; $y = $x; $y =~ s/(2)/?{$1+1}/x; print $y
But instead I get the following:133
Is there a regex way to that? The best non-regex way?1?{2+1}3
In reply to perl code in regex replacement by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |