\.$
The \ is needed to escape the dot so that it is parsed literally (instead of as a dot operator). The $ specifies that that a match is valid only if it occurs at the end of a line.
!$
The exclamation mark ! does not need to be escaped since it has no special meaning as an operator. The $ specifies that that a match is valid only if it occurs at the end of a line.
^[0-9]+\.?[0-9]?\.?[0-9]?\.?[0-9]?
This will match up to four levels deep.
For more information on ICU Regular Expressions see:
http://www.icu-project.org/userguide/regexp.html