Skip to content

Examples

Aditya Rajput edited this page Jan 19, 2026 · 3 revisions

For each filter, you will have to choose which part of the notifications to target, and enter one or two regex patterns to be used while matching. You can target the title, or the content, or either, or both. If you choose to target both, you will have to enter two patterns.

Let's say you wish to target notifications titles of the format "Charging started (27 m until full)". This can be achieved using several patterns.

Contains a certain string somewhere

Charging
until full

Caution

This is usually too broad/generic: it may match notifications that you don't wish to match. Prefer a more specific pattern.

Starts or ends with a certain string

^Charging started
until full\)$

Important

Parentheses must be escaped.

Exactly matches a certain string

^Charging started \(27 m until full\)$

Warning

This will not match, for instance, "Charging started (37 m until full)".

Exactly matches a certain string but with one flexible section

^Charging started \(.* until full\)$

Here are some other templates you may find useful:

Contains one one or more strings from a list

keyword|another string|yet another

Doesn't contain a certain string anywhere

^(?!.*(your string))

Doesn't contain any string from a list

^(?!.*(keyword|another string|yet another))

Use these templates to build your own pattern. You can visit regexr.com to learn more about regex, as well as build & test patterns. For advanced patterns, you can use this playground to test against the actual Kotlin regex engine.

If you're having difficulty targetting certain notifications, you can raise an issue describing your situation.