Sample search

In the sample search, a regular expression can be filled in in order to search, for example, for a specific combination of characters. The Python syntax for regular expressions is used. The search returns a distribution map and examples of the string.

Regular expressions

In regular expressions a number of characters have a special meaning. For example:

.matches any character
^matches the beginning of a string
$matches the end of a string
[]indicates a set of characters
[^]matches characters NOT within the set

Examples of regular expressions:

nfinds all instances which contain the charcater 'n'
ngfinds all instances which contain 'ng'
^afinds all instances of 'a' in the beginning of a string
a$finds all instances of 'a' in the end of a string
^.afinds all instances were 'a' is the second symbol
a.efinds an 'a' followed by any single character followed by an 'e'
[ae]all instances of either 'a' or 'e'
^[ae]all instances beginning with either 'a' or 'e'
[^ae]matches instances NOT containing 'a' or 'e'
[^a]$matches all instances that do NOT end with an 'a'
t[ae]'t' followed by either 'a' or 'e'

previous | Start | next