The rules for building one-character regular expressions that match a single character are:
Any character that is not a special character as defined below matches itself.
The special characters are: + * ? . [ ] ^ $ \
A backslash \ followed by any special character matches the literal character itself; in other words, this escapes the special character.
The period . matches any character except the newline. For example, .umpty matches either Humpty or Dumpty.
A set of characters enclosed in brackets [] is a one- character regular expression that matches any one character from that set. For example, [akm] matches either an a, k, or m. A range of characters can be indicated with a dash. For example, [a-z] matches any lower-case letter. However, if the first character of the set is the caret ^, then the regular expression 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 has no special meaning if it is not the first character of the set.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.