Skip to content

Commit 5a83e1c

Browse files
author
Mercedes Rey
committed
Add the ability to search with a global regex
1 parent 5c69f49 commit 5a83e1c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/util.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ export function searchStrings (strings, term, {caseSensitive, fuzzy, sortResults
6060
}
6161
if (exactMatch) {
6262
term = new RegExp('^' + term + '$', 'i')
63-
}
63+
} else if (regexMatch) {
64+
term = new RegExp(term, 'i')
65+
}
6466
if (value && value.search(term) !== -1) {
6567
return true
6668
}

0 commit comments

Comments
 (0)