Agreed. I've been brainwashed by Redmond to assume that an extension is three characters long. My early DOS training is to blame for that. (good ol' 8.3 notation, you know?)
Using a regex to hunt for the dot is out of the question, because you might have a filename "foo.bar.htm" for example.
Of course, you could always look for the last instance of
the . in the filename, but . . . in the interst of having
clearer code, I like the substr approach better than the
regex (if only this once ;-) )