Hello All, Any ideas how to recreate a dos wildcard filemask of the type "help*.txt" as a string for insertion in a pattern match. At the moment I'm trying to write a subroutine that returns an escaped string which I then insert in my m// ... ie $myregex = &my_regex_generator("help*.txt"); if( $mystring =~ /$myregex/i){do stuff.... at the moment I've got - sub gen_convert_wildcards_to_regexp{ my $wildcardstring = $_[0]; my $regex_string = $wildcardstring; $regex_string =~ s/\./\\\./gi; #escape the dots $regex_string =~ s/\*/\\*/gi; #escape the $regex_string = $regex_string . "\\b\$"; return $regex_string; } Which is pretty crap and fails with the * wildcard