You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/general/ad-filtering/create-own-filters.md
+31-3Lines changed: 31 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -425,6 +425,19 @@ This modifier lets you narrow the rule coverage down to a specific application (
425
425
426
426
For Mac, you can find out the bundle ID or the process name of the app by viewing the respective request details in the Filtering log.
427
427
428
+
**Syntax**
429
+
430
+
The modifier is a list of one or more expressions, each of which is matched against an application in a particular way depending on its type. These expressions are separated by the `|` symbol.
-**`regular_app`** — a regular application name (`example.app`). It corresponds to the specified application and is matched lexicographically.
438
+
-**`wildcard_app`** — an application name ending with a wildcard character `*`, such as `org.example.*` or `com.ad*`. It matches all applications whose names start with the specified prefix. Matching is done lexicographically.
439
+
-**`regexp`** — a regular expression that starts and ends with `/`. It works the same way as the basic URL rules, but the characters `/`, `$`, `,`, and `|` must be escaped with `\`.
440
+
428
441
**Examples**
429
442
430
443
-`||baddomain.com^$app=org.example.app` — a rule to block requests that match the specified mask and are sent from the `org.example.app` Android app.
@@ -435,17 +448,32 @@ If you want the rule not to be applied to certain apps, start the app name with
435
448
-`||baddomain.com^$app=~org.example.app` — a rule to block requests that match the specified mask and are sent from any app except for the `org.example.app`.
436
449
-`||baddomain.com^$app=~org.example.app1|~org.example.app2` — same as above, but now two apps are excluded: `org.example.app1` and `org.example.app2`.
437
450
451
+
You can use wildcards in the `$app` modifier:
452
+
453
+
-`||baddomain.com^$app=org.example.*` — applies to all apps whose package names start with `org.example.`
454
+
455
+
You can use regular expressions in the `$app` modifier by enclosing them in forward slashes `/.../`. This allows for more flexible matching — for example, targeting a group of apps from the same publisher or matching complex patterns.
456
+
457
+
-`||baddomain.com^$app=/org\.example\.[a-z0-9_]+/` — applies to all apps whose package name starts with `org.example` (e.g. `org.example.app1`, `org.example.utility`, etc.).
458
+
-`||baddomain.com^$app=/^org\.example\.app\$\|^org\.example\.[ab].*/` — applies to `org.example.app` and to any app whose package starts with `org.example.a` or `org.example.b`.
459
+
460
+
The `$app` modifier supports combining all three types of entries — plain names, wildcards, and regular expressions — within the same rule, but it does not allow combining negated and non-negated expressions together.
461
+
462
+
-`||example.com^$app=org.example.app|org.example.*|/org\.example\.[a-z]+/` — applies to `org.example.app`, all matching `org.example.*` and `org.example.[a-z]+` apps.
463
+
438
464
:::caution Restrictions
439
465
440
-
Apps in the modifier value cannot have a wildcard, e.g. `$app=com.*.music`.
441
-
Rules with such modifier are considered invalid.
466
+
- Apps in the modifier value cannot include a wildcard inside the string , e.g. `$app=com.*.music`.
467
+
Use a regular expression instead: `$app=/com\..*\.music/`.
468
+
- You cannot combine negated (`~`) and non-negated expressions in the same `$app` modifier — this would be ambiguous.
442
469
443
470
:::
444
471
445
472
:::info Compatibility
446
473
447
474
- Only AdGuard for Windows, Mac, Android are technically capable of using rules with `$app` modifier.
448
475
- On Windows the process name is case-insensitive starting with AdGuard for Windows with [CoreLibs] v1.12 or later.
476
+
- Support for regular expressions and for combining different types of entries (plain names, wildcards, and regular expressions) in the `$app` modifier is available starting from CoreLibs v1.19 or later.
449
477
450
478
:::
451
479
@@ -1939,7 +1967,7 @@ In AdGuard for Windows, Mac and Android with [CoreLibs] v1.11 or later, JSONPath
0 commit comments