fork download
  1. import re
  2. s = '(X_xy09 and X_foobar or (X_abc123 and X_something))'
  3. print(re.sub(r'\b[A-Z]_([a-zA-Z0-9])', r'\1', s))
Success #stdin #stdout 0.02s 6968KB
stdin
Standard input is empty
stdout
(xy09 and foobar or (abc123 and something))