http://www.perlmonks.org?node_id=1053667


in reply to Re: extract file name from path
in thread extract file name from path

I think that you need to add the underscore ('_') to the character class in your regex.

Update: I read too quickly. Reading again your regex, no, there is no need to add the underscore, since this character class is aimed at matching the final "java" extension.