You might like to take a look at the regular expressions in the code for File::Basename (it's commented and everything). On Microsoft Windows the file will probably be in C:\Perl\lib\File\Basename.pm.
Comment on Re: Regular expression to check for invalid file name characters