You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
. is not replaced by . as it produces for "test.txt" the regular expression ^test.txt$ which also matches testatxt.
? is replaced with . as ? as wildcard matches exactly one characted, see https://en.wikipedia.org/wiki/Wildcard_character. Where as .? matches 0 or 1 characters. Hense wildcard a?a would become a.?a and would match aa and aba where the correct match would be only aba
The text was updated successfully, but these errors were encountered:
Generation of search pattern in FindFileSystemEntryInfo is incorrect:
"^" + Regex.Escape(_searchPattern).Replace(@"\.", ".").Replace(@"\*", ".*").Replace(@"\?", ".?") + "$"
correct one is
String.Format("^{0}$", Regex.Escape(part).Replace("\\*", ".*").Replace("\\?", "."))
see http://www.codeproject.com/Articles/11556/Converting-Wildcards-to-Regexes
Importandt is that:
^test.txt$
which also matches testatxt.a.?a
and would matchaa
andaba
where the correct match would be onlyaba
The text was updated successfully, but these errors were encountered: