As Erel wrote, files not necessarily have extension.
Some files have more than one period. Example: project.b4j.meta
Some files have period but behind it I don't consider as extension. Example, .gitignore I consider the filename is the full name including the period.
We can use the last index but then file like project.b4j.meta should be having project as file name and .b4j.meta as extension or is it consider project.meta is actually the file name?
For me the former is more accurate.
This is just my thought.