As so many people are having problems with the fact that OW uses regular expressions instead of glob patterns (like "*.dmg") for ad blocking I decided to write a short HOWTO on using regular expressions. So any questions about that can now be redirected to this thread. ;-)

Glob patterns are the stuff most people are used to, like:
[list][*][b]"*" will match any char, 0 or more times[/b] — "old*" will match "old times", "old news", or "old"; "*new*" will match "something new", "news", or "new".[*][b]"?" will match any single char[/b] — "test.?mg" will match "test.img", "test.dmg", or "test.omg", but not "test.mg"; "test.???" will match "test.txt", "test.htm", or "test.bak", but not "test.html" or "test.js". (Many people don't know this one.)[/list]
To translate these into regular expressions, do the following:
[list][*][b]Replace "*" by ".*"[/b] — "old*" -> "old.*"[*][b]Replace "?" by "."[/b] — "n?w" -> "n.w"[*][b]Escape special characters[/b] — There are several characters that have a special meaning inside a regular expression. If you don't want that meaning, but the literal character, you have to prepend it with a backslash (\). For URLs, the only allowed characters (in URLs) that have a special meaning in regular expressions are ".", "+" and "?". So "some.host.com" becomes "some\.host\.com". You'd also have to escape the "?" and the "+" if you really wanted to match form data, which doesn't really make sense in this context; but nevertheless: "some.host.com\?search=foo+bar" becomes "some\.host\.com\?search=foo\+bar". (As "?" has a special meaning in glob patterns, too, it would also have to be escaped in the glob pattern.)[*][b]You don't have to match the whole string[/b] — Different from glob patterns, regular expressions match anywhere within the string. For example, if you wanted to match anything from some.host.com, in a glob pattern you'd use "http://some.host.com/*". For regular expressions, though, it is enough if your pattern exists somewhere within the string. Thus, "some\.host\.com" is enough. Similarly, the glob pattern "*ad*" has the same effect as the regular expression "ad". See below if you want to match an exact string.[/list]
Some examples:

Ok, you're done. With the knowledge from above, you can translate any glob pattern into a regular expression. If that's enough for you, don't read on. :-)

For now we will see what else can be done with regular expressions, and how regular expressions work. From this point on, it will get rather complicated. So be warned. :-)

[b][size="3"]The Power of Regular Expressions[/size][/b]

I won't explain everything; regular expressions are even more powerful than what I will show you here, but I will try to explain how they work and show you the most useful details for ad blocking.
[list][*][b]How to match an exact string and the end of a string[/b] — As said above, regular expressions pattern will match anywhere within the string. But what if you want to block only a single image from a server? Or if you want to match only if your pattern is at the end of the string? For these cases, use "^" and "$". "^" means "the beginning of the string", "$" means "the end of the string". If you wanted to block "some.host.com/ad.gif", you could use "^http://some\.host\.com/ad\.gif$". If you want to block flash, you'll need to block all URLs that end with ".swf", so "\.swf$" is the pattern of choice.[*][b]A char not followed by a special character means: This char, exactly once.[/b] — This might seem obvious: An "a" means an "a". But the key term is "not followed by a special character". Those special characters can change everything—see below.[*][b]"." means: Any char, exactly once.[/b] — "..." will match "aaa", "abc", "xyz", " " (three spaces) and so on. But remember: It will match anywhere within the string, so it won't match only if the string is shorter than three characters! If you wanted exactly three characters, you could use "^...$".[*][b]"*" means: The char before, 0 or more times.[/b] — "a*" will match "a", "aa", "aaaaaa", and even "" (zero times, too!), but not "b"—anywhere inside the string. So "abc*" will match "This string contains abc.", "The chars ab are part of this string.", or "abccccccccc doesn't make much sense." This is often used with "."—".*" means "any char, 0 or more times".[*][b]"+" means: The char before, 1 or more times.[/b] — Same as above, but the char before has to be there at least once.[*][b]"?" means: The char before, 0 or 1 time.[/b] — "hell?o" will match "hello" and "helo" anywhere inside the string. "htm.?$" will match "htm", "html", "htmx", or "htmu" at the end of the string.[*][b]Character groups[/b] — Now what if you want to match ... say "flash" and "flesh", but nothing else, like "flosh", "flush", or "flxsh"? Regular expressions give you character groups for that. Just put the chars you look for into square brackets. "[abc]" means: An "a", a "b" or a "c", exactly once. In this example, you could use "fl[ae]sh" as your pattern. Of course, this can be combined with all the special characters. But beware: "[abc]*" doesn't only match "aaaaaaaa", "bbbb", and "c", but also "acbabacabacab". But always remember: We match anywhere within the string. "[abc]*" will thus match "kjngkjbfgkjnadkfjn", as there is an "a" in the string. Furthermore, it will even match "kjngkjngtkjrt" where there is no [abc]—"*" says "0 or more times"! "[abc]" or "[abc]+" won't match that string, though, obviously.[*][b]"Negative" character groups[/b] — Often, it's more convenient to say which chars you don't want rather than which you want. If the first character after the opening bracket is a "^", it means "not". So "[^ab]" means "one char, but not 'a' or 'b'". I use this in my ad blocking settings: I have a line that catches at least 70% of the ads shown: It is "/ad[^dm]". Before you read on: Can you tell what it does? Yes, it blocks any URL that has "/ad" somwhere inside, but not followed by a "d" or an "m"—we don't want to block "/additional" stuff or "/admin" pages.[/list]
So.

This is a first step into regular expressions. Yes, they [i]are[/i] complicated, but they are also extremely powerful. There are more options than what I described here, but I think this is by far enough for ad blocking. :-)