I want to know how to remove all periods occurring after the end of a word but not from float values in string.
title= "Remove. dot from here but not from 4.334"
title=re.sub(r'\.', '', title)
You could use an assertion or two:
>>> re.sub(r'(?<!\d)\.(?!\d)', '', title) 'Remove dot from here but not from 4.334'
Precisely negative lookbehind and positive lookahead assertions