[MINI TUTORIAL] What are Regular Expressions (REGEX) and Wilcards? How do they work with iodé?

[MINI TUTORIAL] What are Regular Expressions (REGEX) and Wilcards? How do they work with iodé?

Hi all,

iodéOS 4.6 was released yesterday, with two new customized blocking methods to our adblocker: Wildcard and REGEX.




The execution priority of these methods is 2nd top priority, which means they will be executed after specific recipients customizations but before predefined blocklists (like standard or adult content protection).

Wildcards are special characters that can stand in for unknown characters in a text value and are handy for locating multiple items with similar, but not identical data.
Wildcard rules use the following two special metacharacters:
• ? represents a single (exactly one) character, including space
* represents multiple (zero or more) characters, including space.

REGEX are more complete than wildcards.
A regular expression is a pattern that the regular expression engine attempts to match in input text. A pattern consists of one or more character literals, operators, or constructs.

Official POSIX reference:
Regular Expressions
More comprehensive descriptions:
Regular Expressions/POSIX-Extended Regular Expressions - Wikibooks, open books for an open world
POSIX Extended Regular Expression Syntax - 1.71.0

Wildcard vs REGEX

Example of a REGEX rule that blocks all domains (and their subdomains) starting with ”ads” or ”pubs” and followed by ”.site.com”:

.*\.(ads|pubs)\.site\.com

And its equivalent is done using two Wildcard rules:

 *.ads.site.com
 *.pubs.site.com

Here is another example of an expression that can be used:

.*(ads|pubs)\.(google|facebook).∗\.(com|net)

And its equivalent using Wildcards

 *ads.google*.com
 *ads.google*.net
 *ads.facebook*.com
 *ads.facebook*.net
 *pubs.google*.com
 *pubs.google*.net
 *pubs.facebook*.com
 *pubs.facebook*.net

This blocks all recipients that include ads or pubs subdomains, domains starting by google or facebook (e.g. matching google, googleapis, …), and com or
net extensions.

And finally the last screenshot is the regular expression:

.*google.*

which blocks any recipient containing"google" anywhere in their name.

Happy blocking!

5 Likes