fork download
  1. import re
  2. rx = r'(?<!\S)GBP([\W\d])'
  3. text = 'GBP 5 Off when you spend GBP75.00'
  4. print( re.sub(rx, r\1', text) )
  5.  
Success #stdin #stdout 0.01s 27712KB
stdin
Standard input is empty
stdout
£ 5 Off when you spend £75.00