in reply to Re^2: regex in REPLACEMENT in s///
in thread regex in REPLACEMENT in s///
I probably would have gone for
$res = $str =~ s{ \d+ }{ $& =~ tr//3/cr }xer;
or
$res = $str =~ s{ \d+ }{ 3 x length $& }xer;
TMTOWTDI gone wild :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: regex in REPLACEMENT in s///
by ikegami (Patriarch) on Sep 14, 2023 at 12:41 UTC | |
by tybalt89 (Monsignor) on Sep 14, 2023 at 12:52 UTC |