fork download
  1. import re
  2. text = 'some A.B.B.R.E.V. here.'
  3. pattern = re.compile(r'\b(?:[a-z]\.){2,}', re.I)
  4. text = pattern.sub(lambda m: m.group().replace('.',''), text)
  5. print(text)
Success #stdin #stdout 0.03s 9760KB
stdin
Standard input is empty
stdout
some ABBREV here.