I'm trying to create a function that check if a string (as a file name) match with a particular pattern defined by the user. At the moment I used this simply couple of lines: $pattern = StringReplace($str, "*", "(.*?)") $match = StringRegExp($item, $pattern) $match results 1 if strings match and 0 otherwise. It works fine, but now I have found a problem: if for example is $str = "*.txt" the StringRegExp function return 1 for both $item = "item.txt" and $item = "item.txt.zip" (and so even i