Regex to capture file extension is:
(\\.[^.]+)$
Note that dot needs to be escaped to match a literal dot. However [^.]
is a character class with negation that doesn't require any escaping since dot
is treated literally inside [
and ]
.
\\. # match a literal dot
[^.]+ # match 1 or more of any character but dot
(\\.[^.]+) # capture above test in group #1
$ # anchor to match end of input