From 4639d758967b037383e8bd1b6fdc1c06fac375a5 Mon Sep 17 00:00:00 2001 From: gorhill Date: Fri, 6 Oct 2017 13:35:45 -0400 Subject: [PATCH] fix #3101 --- src/js/reverselookup-worker.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/reverselookup-worker.js b/src/js/reverselookup-worker.js index e8dedb915..8d04148fc 100644 --- a/src/js/reverselookup-worker.js +++ b/src/js/reverselookup-worker.js @@ -100,11 +100,13 @@ var fromCosmeticFilter = function(details) { prefix = match[0], filter = details.rawFilter.slice(prefix.length); + // https://github.com/gorhill/uBlock/issues/3101 + // Use `m` flag for efficient regex execution. var reFilter = new RegExp( - '[^\\n]*\\\\*"' + + '^\\[\\d,[^\\n]*\\\\*"' + reEscapeCosmetic(filter) + - '\\\\*"[^\\n]*', - 'g' + '\\\\*"[^\\n]*\\]$', + 'gm' ); var reHostname = new RegExp(