We're using cookies to make this site more secure, featureful and efficient.

Regular Expressions

Some of the search pages on the SCDDB website, notably the complex dance and recording searches, allow you to enter so called “regular expressions”. These are common in computing circles but may not be widely known elsewhere. Regular expressions are potentially powerful ways of specifying what you would like to search for, but with power can come complexity. This page aims to give an introduction to the basics with some examples for SCD searches. For more details you can follow various links on the web - see below.

Introduction

The main thing you need to know is that some characters have special meanings. The special characters are .*+?[]{}()^$. All other characters just mean what they say.

The most useful is . (dot) which means any character. So searching the database for “a.” can find anything containing “aa”, “ab” to “az”, also “a1”, “a&”, etc.

The special characters *+? say how many of the immediately preceding character you want. The * means any (including none), + means at least one and ? means either one or none. So searching for “ab*” could find just “a” or “ab”, “abb”, “abbbbbb”, etc. Searching for “ab+” would find all of them except just “a” and searching for “ab?” would only find “a” or “ab”, ie just one or no “b”.

A very useful combination is .* which means any number of anything. Typically you might want this if you know the beginning and end of what you are looking for, but not whats in between.

If you want to search for something contains just some selection of characters you can use [], where x[ab]y means you want the middle character to be either a or b (and nothing else), ie xay or xby.

Examples

Suppose you are looking for Miss somebody’s Reel but cannot remember the “somebody”. You should then enter miss.*reel in the search form. Note that in SCDDB the search is case insensitive, ie makes no distinction between upper and lower cases (this is not the usual rule for regular expressions though).

If the list of dances you get from that search does not jog your memory you might wonder if it was really Miss or Mrs. In that case you can try searching for m[ir]s.*reel which should find anything that starts with either mis or mrs and ends with reel.

That might include some (as yet imaginary) dance called The Misplaced Creel so you might really want to restrict the search to the separate words miss or mrs followed by a space and another space before reel. In that case search for m[ir]ss? .* reel where the s? means an optional extra s and that there must then be a space afterwards and before the word reel.

Further reading

Thats probably enough for typical searches in SCDDB, but if you want to know more, then take a look at one or more of:

Navigation
Recently seen

Sign in to see recent visitors!