mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-15 20:26:53 +02:00
improved regex to use with paths
This commit is contained in:
parent
5c6ed227a7
commit
f0c12e4002
|
@ -48,7 +48,7 @@ string wild2regex(const(char)[] pattern)
|
|||
{
|
||||
string regex;
|
||||
regex.reserve(pattern.length + 2);
|
||||
regex ~= "^";
|
||||
regex ~= "(^|/)";
|
||||
foreach (c; pattern) {
|
||||
switch (c) {
|
||||
case '*':
|
||||
|
@ -61,7 +61,7 @@ string wild2regex(const(char)[] pattern)
|
|||
regex ~= ".";
|
||||
break;
|
||||
case '|':
|
||||
regex ~= "$|^";
|
||||
regex ~= "$|(^|/)";
|
||||
break;
|
||||
default:
|
||||
regex ~= c;
|
||||
|
|
Loading…
Reference in a new issue