Well, I saw it as an exercise in using a nested s///. If you don't, then you might as well use:
my $res = $str =~ s/\d/3/gr;
In reply to Re^4: regex in REPLACEMENT in s///
by ikegami
in thread regex in REPLACEMENT in s///
by perlboy_emeritus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |