aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2016-05-23 23:06:37 +0200
committerKristian Lyngstol <kristian@bohemians.org>2016-05-23 23:06:37 +0200
commit58875862f3e882cdbdd04ea3129646d9e9b1e173 (patch)
tree7a1327bdebbda4030e746a0dc913a7f8452d3eef
parent83cf935cc8f3064345e3a5255a91224ce9d02b9a (diff)
front: Regex searching instead of home-brew thingamajing
-rw-r--r--web/js/nms-search.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/web/js/nms-search.js b/web/js/nms-search.js
index 748c8c2..f5cfb8c 100644
--- a/web/js/nms-search.js
+++ b/web/js/nms-search.js
@@ -21,7 +21,8 @@ nmsSearch.helpText = [
*/
nmsSearch.searchTest = function(id, sw) {
try {
- if(sw.toLowerCase().indexOf(id.toLowerCase()) > -1) {
+ var re = new RegExp(id,"i");
+ if(re.test(sw)) {
return true;
}
if (id[0] == "\"") {