in reply to how to Check file type?

Most people just look at the letters following the last '.' and call it a day.

You want to look for (ie: regex) a literal '.' (use a backslash), plus up to three characters that are not dots, then the end of string. And capture those characters.