By default . only matches non-line terminator characters, and $ will match only the start and end of the text. So in
XXX.YYY
XXX - YYY
XXX/YYY
\..*$
will not match because the .* only matches until the end of the line, and the $ will only match at the end of the text.
If you wish to match everything from the . onwards until the end of the text, then you need to turn on the sflag option with either: \.(?s:.)* or (?s)\..*.
Note in both cases you don't need the $ (or better \z) because the .* will match everything until the end of the text.