User Guide

Using regular expressions 109
Any regular expression can be followed by one of the following suffixes:
{m,n} forces a match of m through n (inclusive) occurrences of the preceding
regular expression
{m,} forces a match of at least m occurrences of the preceding regular
expression
The syntax {,n} is not allowed.
A range of characters can be indicated with a dash. For example,
[a-z] matches
any lowercase letter. However, if the first character of the set is the caret (^), the
RegExp matches any character except those in the set. It does not match the
empty string. For example,
[^akm] matches any character except a, k, or m. The
caret loses its special meaning if it is not the first character of the set.
All regular expressions can be made case-insensitive by substituting individual
characters with character sets, for example,
[Nn][Ii][Cc][Kk].
Using a character class
You can specify a character by using a POSIX character class. You enclose the
character class name inside two square brackets, as in this example:
"Macromedia’s Website","[[:space:]]","*","ALL")
This code replaces all the spaces with *, producing this string:
Macromedia’s*Website
The following table shows the supported POSIX character classes:
Character
class Matches
alpha Any letter, [A-Za-z]
upper Any uppercase letter, [A-Z]
lower Any lowercase letter, [a-z]
digit Any digit, [0-9]
alnum Any alphanumeric character, [A-Za-z0-9]
xdigit Any hexadecimal digit, [0-9A-Fa-f]
space A tab, new line, vertical tab, form feed, carriage return, or space
print Any printable character
punct Any punctuation character:
! ‘ # S % & ‘ ( ) * + , - . / : ; < = > ? @ [ / ] ^ _ { | } ~
graph Any character defined as a printable character except those defined as
part of the space character class
cntrl Any character not part of the character classes:
[:upper:], [:lower:], [:alpha:], [:digit:], [:punct:], [:graph:], [:print:], [:xdigit:]