92
Character classes
You can specify a character by using a POSIX character class. You enclose the
character class name inside two square brackets, as in this Replace example:
"Macromedia's Web Site","[[:space:]]","*","ALL")
This code replaces all the spaces with *, producing this string:
Macromedia's*Web*Site
The following table shows the supported POSIX character classes:
Character
Class
alpha
upper
lower
digit
alnum
xdigit
space
print
punct
graph
cntrl
Multicharacter regular expressions
You can use the following rules to build multicharacter regular expressions:
Parentheses group parts of regular expressions together into grouped
subexpressions that can be treated as a single unit. For example, (ha)+ matches
one or more instances of "ha".
A one-character regular expression or grouped subexpressions followed by an
asterisk (*) matches zero or more occurrences of the regular expression. For
example, [a-z]* matches zero or more lowercase characters.
A one-character regular expression or grouped subexpressions followed by a plus
(+) matches one or more occurrences of the regular expression. For example,
[a-z]+ matches one or more lowercase characters.
A one-character regular expression or grouped subexpressions followed by a
question mark (?) matches zero or one occurrences of the regular expression. For
example,
Matches
Any letter, [A-Za-z]
Any uppercase letter, [A-Z]
Any lowercase letter, [a-z]
Any digit, [0-9]
Any alphanumeric character, [A-Za-z0-9]
Any hexadecimal digit, [0-9A-Fa-f]
A tab, new line, vertical tab, form feed, carriage return, or space
Any printable character
Any punctuation character:
! ' # S % & ' ( ) * + , - . / : ; < = > ? @ [ / ] ^ _ { | } ~
Any character defined as a printable character except those defined as
part of the space character
Any character not part of the character classes:
[:upper:], [:lower:], [:alpha:], [:digit:], [:punct:], [:graph:], [:print:], [:xdigit:]
xy?z
matches either "xyz" or "xz".
Chapter 7 Using Web Development Languages
class
Need help?
Do you have a question about the COLDFUSION STUDIO 5-USING COLDFUSION 5 STUDIO and is the answer not in the manual?