Something like this:
/[abcd]/[efgh]/
The idea is that a
will get replaced with e
, b
with f
, c
with g
and so on.
Ideally, this should be language independent. If that isn't possible, I have an alternate solution (because this regex is generated by some code, I can make one for each of the possible replacements).