skip slash from regex match

This commit is contained in:
skilion 2015-09-20 20:23:09 +02:00
parent 30504d7034
commit 4498c03dec

View file

@ -52,13 +52,13 @@ string wild2regex(const(char)[] pattern)
foreach (c; pattern) { foreach (c; pattern) {
switch (c) { switch (c) {
case '*': case '*':
regex ~= ".*"; regex ~= "[^/]*";
break; break;
case '.': case '.':
regex ~= "\\."; regex ~= "\\.";
break; break;
case '?': case '?':
regex ~= "."; regex ~= "[^/]";
break; break;
case '|': case '|':
regex ~= "$|(^|/)"; regex ~= "$|(^|/)";