in reply to Re^5: Pattern matching simultaneous substitution
in thread Pattern matching simultaneous substitution

I don't think your code works. When I run it for input
ssDDssUUss

it returns

OOMMIIMMss

while you previously claimed the correct output is

OOMMIIMMOO

Similarly,

ssUUssDDss

is transformed into

IIMMOOMMss

while the correct output should be

IIMMOOMMII

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^7: Pattern matching simultaneous substitution
by Anonymous Monk on Jan 05, 2022 at 22:12 UTC
    You were right, thanks! I added a last regex substitution to cover the last part :)
    Thanks again!