Searchpattern> attributes – Adobe Extending Dreamweaver CS4 User Manual
Page 277
271
EXTENDING DREAMWEAVER CS4
Server behaviors
Parent
searchPatterns
Type
Block tag.
Required
Yes.
Values
searchString, /regularExpression/,
•
The searchString value is a simple search string that is case-sensitive. It cannot be used to extract parameters.
•
The /regularExpression/ value is a regular expression search pattern.
•
The
the first parameter.
In the following example, to identify the participant text
<%= RS1.Field.Items("author_id") %>
, you can define
a simple pattern, followed by a precise pattern that also extracts the two parameter values:
This example matches the pattern precisely and assigns the value of the first subexpression (
\w+
) to parameter
rs
and
the second subexpression (
\w+
) to parameter
col
.
Note: It is important that regular expressions start and end with a slash (/). Otherwise, the expression is used as a literal
string search. Regular expressions can be followed by the regular-expression modifier
i
to indicate case-insensitivity (as
in
/pattern/i
). For example, VBScript is not case-sensitive, so it should use
/pattern/i
. JavaScript is case-sensitive
and should use
/pattern/
.
Sometimes you might want to assign the entire contents of the limited search location to a parameter. In that case,
provide no pattern, as shown in the following example:
This example sets the
optionLabel
parameter to the entire
innerHTML
contents of an
OPTION
tag.
The following items are valid attributes of the
searchPattern
tag.