Specifications
Chapter 14174
EDML Tag: updatePattern
Description
A specific type of regular expression that allows precise updates of participant text. There should
be at least one update pattern definition for every unique parameter that is declared in the
insertion text (of the form
@@paramName@@).
Parent
updatePatterns
Type
Block tag.
Required
Yes (at least one, if the updatePatterns tag is declared).
Values
A regular expression that finds a parameter between two parenthetical subexpressions, in the form
/(pre-pattern)parameter-pattern(post-pattern)/. You need at least one update pattern
defined for each unique
@@paramName@@ in the insertion text. The following example shows how
your insertion text might look:
<insertText location="afterSelection">
<![CDATA[<%= @@rs@@.Field.Items("@@col@@") %>]]>
</insertText>
A particular instance of it on a page might look like the following example:
<%= RS1.Field.Items("author_id") %>
There are two parameters, rs and col. To update this text after it is inserted on the page, you
need two update pattern definitions:
<updatePattern paramName="rs" >
/(\b)\w+(\.Field\.Items)/
</updatePattern>
<updatePattern paramName="col">
/(\bItems\(")\w+("\))/
</updatePattern>
The literal parentheses, as well as other special regular expression characters, are escaped by
preceding them with a backslash (\). The middle expression, defined as
\w+, is updated with the
latest value that passed in for parameters
"rs" and "col", respectively. The values "RS1" and
"author_id" can be precisely updated with new values.
Multiple occurrences of the same pattern can be updated simultaneously by using the regular
expression global flag
"g" after the closing slash, such as /pattern/g.
If the participant text is long and complex, you might need multiple patterns to update a single
parameter, as shown in the following example:
<% ...
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 3;
%>