Create a regex expression to remove all characters in a string after the last dot in the string. For example, if I have a pattern of "X.Y.4" I want the number 4 and the dot to be removed.