I found this related question : In perl, backreference in replacement text followed by numerical literal but it seems entirely different. I have a regex like this one
s/([^0-9])([xy])/\1 1\2/g
^
whitespace here
But that whitespace comes up in the substitution.
How do I not get the whitespace in the substituted string without having perl confuse the backreference to
\11
?
For eg.
15+x+y
changes to 15+ 1x+ 1y
.
I want to get 15+1x+1y
.