This would handle a case where the file name contained a period, such as file.name.a01. The original would process that as name.a01, which doesn't sound like the intent. This would change to look for the last period in the name and not the first period.

If you wanted to instead look strictly at the last 3 characters of the name, as the post title suggests, then it would be: