From 2f28c559c182374cc1e7d3592603a1c4dc2c7771 Mon Sep 17 00:00:00 2001 From: garry-ut99 <72945564+garry-ut99@users.noreply.github.com> Date: Sat, 6 Jul 2024 13:21:40 +0000 Subject: [PATCH] Updated description of "regex-based values as target domain for static extended filters" + more examples + link to related issue --- Static-filter-syntax.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Static-filter-syntax.md b/Static-filter-syntax.md index 19433ca..18ecfe0 100644 --- a/Static-filter-syntax.md +++ b/Static-filter-syntax.md @@ -2,7 +2,16 @@ uBlock Origin (uBO) supports most of the EasyList filter syntax. You can refer t While uBO does not support some specific cases, it further extends the EasyList filter syntax, which also may share with AG's extended syntax. [Here](./Syntax-quirks) are the most surprising cases documented. -Starting with [1.46.1b15](https://github.com/gorhill/uBlock/commit/81498474d6d440b032681aa9952d593749b39efb), you can use regex-based values as target domain for static extended filters. Example of usage: `/img[a-z]{3,5}\.buzz/##+js(nowoif)`. Use sparingly, when no other solution is practical from a maintenance point of view -- keeping in mind that uBO has to iterate through all the regex-based values, unlike plain hostname or entity-based values which are mere lookups. +Starting with [1.46.1b15](https://github.com/gorhill/uBlock/commit/81498474d6d440b032681aa9952d593749b39efb), you can use regex-based values as target domain for static extended filters. Examples of usage: +- `/img[a-z]{3,5}\.buzz/##+js(nowoif)` +- solves: [Hiding rules are unable to specify to only block on the core domain and none of the subdomains (e.g. ~*.example.org doesn't work)](https://github.com/uBlockOrigin/uBlock-issues/issues/3291) : + - `/^example\.org$/##h1` - matches only `example.org` without subdomains + - `/^www\.example\.org$/##h1` - matches only `www.example.org` without subdomains and without `example.org` + - `/^(?:www\.)?example\.org$/##h1` - matches only `example.org` + `www.example.org` without subdomains + +- `/^example\.org$/,somesite.org##h1` - can also be combined with normal names + +Use sparingly, when no other solution is practical from a maintenance point of view -- keeping in mind that uBO has to iterate through all the regex-based values, unlike plain hostname or entity-based values which are mere lookups. - [Not supported](#not-supported) - [Pre-parsing directives](#pre-parsing-directives)