I want to replace every dot with a space in a sentence except when it is used with an abbreviation. When it is used with an abbreviation, I want to replace it with '' NULL.
Abbreviation means a dot surrounded at least two Capital letters.
My regex are working except they catch U.S.
r1 = r'\b((?:[A-Z]\.){2,})\s*'
r2 = r'(?:[A-Z]\.){2,}'
'U.S.A is abbr x.y is not. But I.I.T. is also valid ABBVR and so is M.Tech'
should become
'USA is abbr x y is not But IIT is also valid ABBVR and so is MTech'
UPDATE: It should not be considering any numbers or special characters.
X.2 -> X 2
X. -> X
X.* -> X -