Comparision with Edit's search

One of the comments often heard about StrongED is that its advanced search is difficult to understand and that it would be easier if searching was more like that of Edit.

This article is an attempt to demystify StrongED's Advanced search by comparing it with Edit's Wildcarded expressions and Magic characters.

Both Edit and StrongED offer a 'simple' search mode where none of the characters have special meaning. That is, the text entered in the search window will be exactly what is matched against. Entering 'White' will match any occurence of the string 'White'.

Whilst 'simple' search is very easy to use it is also rather limited in what it can do, for example matching all telephone numbers in a list of address data is impossible since one cannot define a search string that would match an arbitrary number.

To be able to do this one must have the ability to define patterns to match, and that is what precisely why Edit and StrongED offer a more complex search mode. These search modes attribute special significance to certain characters and sequences to allow the construction of patterns that provide much more control over what is to be matched.

Edit, in fact, offers two such modes each with its own syntax. One is called Magic characters which uses escape sequences to denote various elements. The other is called Wildcarded expressions. StrongED has only one mode, called Advanced search, but it allows similar constructs as both modes of Edit.

The table below provides a quick overview of constructs that Edit's search modes offer, what the equivalent StrongED constructs are and brief description of what they do. Please note though that equivalent constructs may differ in some detail, a few of these differences are noted in the description.


StrongED vs Edit search expressions
Wildcarded expressions
Edit StrongED Description
. . any character (doesn't match \n in StrongED)
$ $ newline character
@ AD alphanumeric (doesn't match '_' in StrongED)
# # digit (decimal)
X \cX control code X
\ "\" literal \
[..] '..' set (aka class)
~ ~ not
* {} zero or more
^ {}+ one or more
 % most (no StrongED equivalent)
& @@ entire matched string
 ?n @nm match field n (in Edit in replace only)
Magic characters
Edit StrongED Description
\. . any character (doesn't match '\n' in StrongED)
\a \w alphanumeric (doesn't match '_' in StrongED)
\d \d digit (decimal)
\xXX \xXX character with ascii code XX
\n \n newline
\\ \\ backslash
\* * any string (doesn't match '\n' in StrongED)
\cX \cX control code X

 

Valid HTML 4.01! RISC OS