Substitua pelo grupo de captura regex
str.replace(/(?<=name="\w+)\d+(?=\w+")/, '!NEW_ID!') // look behind & look ahead
Witty Wolverine
str.replace(/(?<=name="\w+)\d+(?=\w+")/, '!NEW_ID!') // look behind & look ahead
print(readline().replace(/(\d+)(.) ?/g,(a,b,c)=>c.repeat(b)))