in reply to regex in REPLACEMENT in s///
($res = $str) =~ s{ (\d+) }{ ($adj = $1) =~ s/(\d)/3/g; $adj }xe;
or
($res = $str) =~ s{ (\d+) }{ $1 =~ s/(\d)/3/gr }xe;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex in REPLACEMENT in s///
by ikegami (Patriarch) on Sep 12, 2023 at 22:53 UTC | |
by tybalt89 (Monsignor) on Sep 12, 2023 at 23:21 UTC | |
by ikegami (Patriarch) on Sep 14, 2023 at 12:41 UTC | |
by tybalt89 (Monsignor) on Sep 14, 2023 at 12:52 UTC | |
|
Re^2: regex in REPLACEMENT in s///
by perlboy_emeritus (Scribe) on Sep 12, 2023 at 20:13 UTC |