fast pattern matching in filepath_match