From: Mischa POSLAWSKY Date: Tue, 29 Sep 2020 16:04:27 +0000 (+0200) Subject: browser: fix regexp for case insensitive search X-Git-Tag: v1.13~193 X-Git-Url: http://git.shiar.net/sheet.git/commitdiff_plain/37debe16b64c1d34a9d4a4ed5171b124a0fffab2 browser: fix regexp for case insensitive search Ignored when applied to match function, even following a RegExp. --- diff --git a/searchlocal.js b/searchlocal.js index 512f07b..6498e32 100644 --- a/searchlocal.js +++ b/searchlocal.js @@ -106,7 +106,7 @@ if (document.querySelector !== undefined) { else { // title text (case-insensitive unless caps in input) var match = function(row) { - return row.cells[1].textContent.match(query, /[A-Z]/.test(query) ? '' : 'i'); + return row.cells[1].textContent.match(new RegExp(query, /[A-Z]/.test(query) ? '' : 'i')); }; } filterrows(table, match, action || 'filter');