Modified user search to include whole word search

This commit is contained in:
Wyatt Johnson
2017-10-11 16:41:09 -06:00
parent 1fffa1427d
commit 86f48cea96
5 changed files with 66 additions and 12 deletions
+10
View File
@@ -0,0 +1,10 @@
/**
* Escape string for special regular expression characters.
*/
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}
module.exports = {
escapeRegExp,
};