Use fnmatch instead of regex and revert back permission