That just uses the standard python regex re() module, running the regex "[.]$" and replacing it with "" -- the dot is surrounded by brackets to escape its special meaning as match-any-one-character, but you could do the same with "\.$" and of course, the Dollar sign matches the end-of-line border. So you are matching a dot (not any-character) followed by the end of the field.
A regex to match any dot would be "\." since it doesn't only look for the one right before the end-of-line border as indicated by "$".
In order to better understand regex, you may wish to read a tutorial, like the one here:
http://www.regular-expressions.info