in reply to Search and replace with expansion
McA
Nice! But note that you can get the effect of the eval by adding a second /e modifier instead:
22:18 >perl -wE "my $s = '1 2 3*2 4 5x3'; $s =~ s/(\d+)[xX*](\d+)\s*/q +q['$1 ' x $2]/gee; say qq[\n|$s|];" |1 2 3 3 4 5 5 5 | 22:19 > [download]
Hope that’s of interest,
Thank you for that comment, Athanasius!
It is interesting, at least for me.