s/(?<=[a-zA-Z])[12]/ $& == 1 ? 2 : 1 /eg; [download]
In reply to Re: replace a digit with another digit by davidrw in thread replace a digit with another digit by kevyt