Skip to content

Commit

Permalink
regex for /+/
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Apr 7, 2024
1 parent b174af6 commit 462fdba
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,11 @@ function pattern2RegEx(pattern, adapter) {
(pattern[pattern.length - 1] === '+' && pattern[pattern.length - 2] !== '.'))) {
return '';
}
pattern = '^' + pattern + '$';
pattern = pattern.replace(/#/g, '*');
pattern = pattern.replace(/\./g, '\\.');
if (pattern[1] === '*') {
pattern = '^.' + pattern.substring(1);
}
pattern = pattern.replace(/\\\.\*/g, '(\\..*)?');
pattern = pattern.replace(/\+/g, '[^.]*');
pattern = pattern.replace(/\+/g, '[^\\.]*');
pattern = '^' + pattern + '$';
return pattern;
}

Expand Down

0 comments on commit 462fdba

Please sign in to comment.