diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2016-05-23 23:06:37 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2016-05-23 23:06:37 +0200 |
commit | 58875862f3e882cdbdd04ea3129646d9e9b1e173 (patch) | |
tree | 7a1327bdebbda4030e746a0dc913a7f8452d3eef | |
parent | 83cf935cc8f3064345e3a5255a91224ce9d02b9a (diff) |
front: Regex searching instead of home-brew thingamajing
-rw-r--r-- | web/js/nms-search.js | 3 |
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] == "\"") { |