Area search with regular expressions

Since version 3.4.1, the Dolphin Viewer 3 has the new, improved Area Search from FireStorm, where one of the major improvements is the ability to search using ‘regular expressions’.

But what is a regular expression?

Wikipedia says:

In computing, a regular expression provides a concise and flexible means to “match” (specify and recognize) strings of text, such as particular characters, words, or patterns of characters. Common abbreviations for “regular expression” include regex and regexp.

Doesn’t really explain much, does it?

A regular expression is a weird-looking mish mash of characters, numbers, and punctuation, that, in case of Area Search, can mean stuff like “Find all objects with the text BLERGH followed by a number with at least 3 but not more than 5 digits in the name.”

That example, as a regex, would be BLERGH\d{3,5} .

Another example … let’s assume you breed ABC horses, and you want Area Search to show you a list of all horses around you. You know that an ABC horse has its ID as description. The ID is always 7 digits long. So the regex is \d{7} (any digit, repeat 7 times).

For your convenience I’ve located this table of example regexes, and this handy regex generator. There’s also a regex cheat sheet on the internet.

There is one caveat to observe when using regexes in Area Search: As soon as you switch to regular expressions, the expression has to match the whole text field. For example, that “BLERGH\d{3,5}” example above means the name of an object has to be something like BLERGH124, while in normal search mode it is enough for the name to contain the search text.

More useful examples:

– finding all objects where the name does not contain “demo”: ^((?![dD][eE][mM][oO]).)*$
this is quite useful to combine with “for sale” and a price range 🙂