From f46e5ef3b5595a2dbb561eb39eb7706e31d9a287 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 17 Nov 2022 13:17:32 -0500 Subject: [PATCH] Further fix tokenization from regex As per feedback/discussion: - https://github.com/uBlockOrigin/uBlock-issues/issues/2368 - https://github.com/uBlockOrigin/uBlock-issues/issues/2367 --- src/js/static-filtering-parser.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/js/static-filtering-parser.js b/src/js/static-filtering-parser.js index 56bc7e21b..630ffd431 100644 --- a/src/js/static-filtering-parser.js +++ b/src/js/static-filtering-parser.js @@ -3043,12 +3043,10 @@ Parser.utils = Parser.prototype.utils = (( ) => { } case 4: /* T_GROUP, 'Group' */ { if ( - node.flags.LookAhead === 1 || node.flags.NegativeLookAhead === 1 || - node.flags.LookBehind === 1 || node.flags.NegativeLookBehind === 1 ) { - return ''; + return '\x01'; } return this.tokenizableStrFromNode(node.val); } @@ -3156,7 +3154,7 @@ Parser.utils = Parser.prototype.utils = (( ) => { } catch(ex) { } // Process optional sequences - const reOptional = /[\x02\x03]+/g; + const reOptional = /[\x02\x03]+/; for (;;) { const match = reOptional.exec(s); if ( match === null ) { break; }