How do I determine the file extension of a file name string?
lets say I have
I'm.a.file.name.tXt
the regex should return tXt
How do I determine the file extension of a file name string?
lets say I have
I'm.a.file.name.tXt
the regex should return tXt
/^(.*?)\.(.*)$/
The '?' makes it greedy. Your result will be in the second group.
What language is this in? It's quite possible you don't want to actually use a regex - assuming the name is a String you'll probably just want to do something like split it over periods and then choose the last segment. Okay, that's sort of a regex answer, but not a proper one.
You probably don't need regex - most languages will have the equivalent to this:
ListLast(Filename,'.')
(If you do need regex for some reason, Scharron's answer is correct.)