Create filters manually
Create Filters Manually
As an alternative to the Automatic Filters system and the Filter-Assistant, you can create Ignore and Watch filters manually.
Enter one filter expression per line. All filter definitions are case-insensitive and are internally converted to lowercase.

The button New Ignore Filter or New Watch Filter opens a dialog where you can enter and validate a new filter expression. The button Test selected line validates the filter expression in the active line. The button Test filter tests all filter definitions by comparing the filtered text content of the new page with the filtered text content of the old page.
Each line can contain one of the following elements:
- Static text phrase
Use this type to ignore specific phrases on a page. - Text with a wildcard
A wildcard filter is typically used to ignore areas of a page with a defined start and end text. - Regular expression
Regular expressions allow you to define complex filter expressions. They must be placed in special function names, for example "regex(...)".
Wildcard Filter
WebSite-Watcher supports three types of wildcard filters. Only one wildcard is allowed per filter expression.
- *EndText
Filters everything from the beginning of the page to the first occurrence of "EndText".
Example: *Daily News - StartText*EndText
Filters all text areas that begin with "StartText" and end with "EndText".
Example: Downloads:*Publisher - StartText*
Filters everything from the last occurrence of "StartText" to the end of the page.
Example: Users online*
Regular Expressions
WebSite-Watcher supports PERL5-compatible regular expressions for complex filter definitions. Regular expressions must be placed in one of the following functions:
- regex( ... )
Filters all matches of the defined regular expression.
Example: regex(\d+ downloads) - FirstRegex( ... )
Filters only the first occurrence of the defined regular expression.
Example: FirstRegex(\d+ downloads) - StartToRegex( ... )
Filters everything from the beginning of the page to the first occurrence of the defined regular expression.
Example: StartToRegex(\d+ visitors) - RegexToRegex( ... , ... )
Filters everything between two regular expressions.
Example: RegexToRegex(Downloads\: \d+,License\:) - RegexToEnd( ... )
Filters everything from the last occurrence of the defined regular expression to the end of the page.
Example: RegexToEnd(\d+ users online) - RegexCmp( ... )
Finds a defined regular expression, extracts all digits from the result, and compares them with a predefined number. This can be used, for example, to extract and compare prices, and trigger a match only if a value is higher than a specified threshold.
Example: RegexCmp(\d+(\[,\.\]\d+)* Euro;,; > 1000)
CSS-Based Filters
Page content can also be ignored or watched by CSS class names or IDs.
- css( ... )
Ignores or watches all text content formatted with the defined CSS class or ID. The concrete syntax and behavior are described below.
Syntax of CSS Filters
WebSite-Watcher supports different types of CSS filters. The main syntax is css(NAME). This type is also created and used by the Filter-Assistant.
|
Syntax |
Description |
|
css(name) |
Matches all elements with id="name" or class="name". This is the default filter type used by the Filter-Assistant and is sufficient for most use cases. Example: css(header-menu) Matches: <div id="header-menu"> or <h1 class="header-menu">. |
|
css(#name) |
Matches all elements with id="name". Example: css(#header-menu) Matches: <div id="header-menu">...</div>. |
|
css(.name) |
Matches all elements with class="name". Example: css(.top-bar) Matches: <div class="top-bar">...</div>. |
|
css(.name*) |
Matches all elements with a class attribute that contains "name", for example class="name name2". Please note that you can use either the asterisk (*) or the question mark (?), but not both together. Example: css(.dropdown*) Matches: <div class="left dropdown">...</div>. |
|
css(abc?xyz) css(#abc?xyz) css(.abc?xyz) |
In class attributes and ID attributes, the question mark (?) can be used as a wildcard. Please note that you can use either the asterisk (*) or the question mark (?), but not both together. Example: css(.menu?t) |
The Order of Filters Is Important
Filters are executed from top to bottom. The filter in the first line is executed before the filter in the second line.
Content removed by a filter is no longer available for subsequent filters.
Example:
You have defined the following Ignore filters:
Watcher
WebSite-Watcher
The first filter removes all occurrences of "Watcher". The second filter cannot find a match because "Watcher" has already been removed.
The correct order is:
WebSite-Watcher
Watcher
In this order, the first filter removes "WebSite-Watcher". The second filter then removes any remaining occurrences of "Watcher".
Outdated Filters
Outdated Ignore filters are detected and deleted automatically after some time if they no longer match any content. There is no need to delete Ignore filters manually. This behavior can be disabled in the Tweaks section, although this is not recommended.
Outdated Watch filters are not deleted automatically and must be maintained manually.
Test Your Filter Settings
Use the "Test filter" feature to verify your filter definitions.
- Open the Bookmark properties.
- Click the "Filter-Assistant" button or the text "Manual text filter".
- Enter the filter definitions.
See also: