Using Query Expressions
289
Searching for wildcards as literals
To search for a wildcard character in your collection, you need to escape the
character with a backslash (\); for example:
•
To match a literal asterisk, you precede the * with two backslashes: "a\\*"
•
To match a question mark or other wildcard character: "Checkers\?"
Searching for special characters as literals
You must precede the following nonalphanumeric characters with a backslash
character (\) in a search string:
•
comma (,)
•
left and right parentheses ()
•
double quotation mark (")
•
backslash (\)
•
at sign (@)
•
left curly brace ({)
•
left bracket ([)
•
less than sign (<)
•
backquote (‘ )
In addition to the backslash character, you can use paired backquotes (‘ ‘ ) to
interpret special characters as literals. For example, to search for the wildcard string
“a{b” you can surround the string with backquotes, as follows:
`
a{b
`
To search for a wildcard string that includes the literal backquote character (`) you
must use two backquotes together and surround the whole string in backquotes:
`
*n
``
t
`
You can use paired backquotes or backslashes to escape special characters. There is
no functional difference between the two. For example, you can query for the term:
<DDA> in the following ways:
\<DDA\>
or
‘<DDA>‘
{ }
Curly braces. Matches any one of a set of patterns separated by a
comma, as in “hoist{s, ing, ed}”, which locates “hoists,” “hoisting,” and
“hoisted”.
^
Caret. Matches any character not in the set, as in “sl[^ia]m”, which
locates “slum” but not “slim” or “slam.”
-
Hyphen. Specifies a range of characters in a set, as in “c[a-r]t”, which
locates every word beginning with “c,” ending with “t,” and containing
any letter from “a” to “r.”
Wildcard
Description
Summary of Contents for COLDFUSION 5-DEVELOPING
Page 1: ...Macromedia Incorporated Developing ColdFusion Applications MacroMedia ColdFusion 5 ...
Page 58: ...38 Chapter 3 Querying a Database ...
Page 134: ...114 Chapter 7 Updating Your Database ...
Page 210: ...190 Chapter 10 Reusing Code ...
Page 232: ...212 Chapter 11 Preventing and Handling Errors ...
Page 238: ...218 Chapter 12 Using the Application Framework ...
Page 262: ...242 Chapter 12 Using the Application Framework ...
Page 278: ...258 Chapter 13 Extending ColdFusion Pages with CFML Scripting ...
Page 320: ...300 Chapter 15 Indexing and Searching Data ...
Page 336: ...316 Chapter 16 Sending and Receiving E mail ...
Page 374: ...354 Chapter 18 Interacting with Remote Servers ...