Skip to content

Commit

Permalink
Add the ability to search with a global regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Mercedes Rey committed Jul 24, 2019
1 parent 5c69f49 commit 5a83e1c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export function searchStrings (strings, term, {caseSensitive, fuzzy, sortResults
}
if (exactMatch) {
term = new RegExp('^' + term + '$', 'i')
}
} else if (regexMatch) {
term = new RegExp(term, 'i')
}
if (value && value.search(term) !== -1) {
return true
}
Expand Down

0 comments on commit 5a83e1c

Please sign in to comment.