Regular Expression Summary

The following special characters are interpreted in regular expressions

Table 3.7: Regular Expression Characters



^ (at the beginning only)

beginning of line


any single character. In multi-line mode, this also matches the end-of-line character.


any single character that belongs to the set abc


any single character that does not belong to the set abc


zero or more occurrences of the preceding character


one or more occurrences of the preceding character


a tab character


a space character


white space (a tab or a space char­acter)


new-line, or the end-of-line charac­ter. Use this if you want to match a line break in the middle of a pat­tern.


the end of the line

Sets, such as [abc] may be in the following formats.

Table 3.8: Regular Expression Sets

Set type


[<character list>]
eg.  [abcde]

Matches any character within the set. The set can be any number of characters long.

eg. [a-z]

Matches on any character within the range of x through y, inclu­sively. The ASCII value of x must be less than that of y.

eg. [WXYa-z0-9]

Character lists and ranges may be combined.