Our Search Engine

Many of our programs contain within them a powerful search tool, called wagrep. This is a program developed by Steve Braham, Director of the Polymath Development Group at the CECM, by modification of Wu and Manber's agrep, a fast and flexible approximate pattern searching tool. The extended routine is better suited to the web environment, but essentially has the same functionality.

In its simple search mode, wagrep searches for either a substring match to the required text, so that Bra matches Braham, or a word match, in which case the matched string must be a separate word (i.e. Braham no longer matches Abraham).

Searches are then made more powerful by wagrep's best match capability. When turned on (can be turned off by selecting exact match), the program will find the closest match to your string, within a specific number of errors (generally with a default of three). The latter allows things like Brayham to find Braham.

For anything more complicated we have advanced mode, which can also be used with exact or best match (and can be a substring or word match).


The following syntax applies to advanced mode searches only:
Alternation
You can give a list of words for the program to match with lines like Stephen|Steven, which will match either word.
Single character lists
You can include lists of characters like J[aeiou]sup, to match Jasup, Jesup and so on.
Single character ranges
S[a-c] matches Sa, Sb and Sc.
Single matches to any character
Fr.d will match Fred, Frod and so on.
Optional characters
You can make a character optional by following it with a "?". For instance, Berg?stein will match Berstein and Bergstein.
Repeated characters and wild cards
You can match similarly zero/multiple repeats of a character with "*". So, Bo*ld matches Bld, Bold, Boold etc. You can use "+" in the same way if you want at least one occurence (Bld wouldn't match). ".*" matches anything, but we recommend using "#", which is faster (i.e. Br#am will match Braham).
Bracketing
To support complicated constructs, you can surround expressions with "(" and ")". So, (Braham|Goode).*(Stephen) will give you the e-mail addresses of myself and Stephen Goode (surnames come first).
Boolean operations
wagrep and agrep support a simple boolean capability. ";" is the and operation, so that Smith;John only finds John Smith. On the other hand, "," is the or operation, so that Smith,John finds all the Smith's and John's in the file. They cannot be combined in the present version.
Back to the: Search screen
In case of problems, contact:
Terry Stanway (tstanway@cecm.sfu.ca)