Replacement string metacharacters – Rockwell Automation 2755 AdaptaScan Software User Manual
Page 204

Metacharacters
C–4
Use these metacharcters in the message Pass/Fail replacement
strings. They cannot be used in the message find string or match
table rule.
Replacement String Metacharacters
Character
Description and Use
\n
The backslash plus a number 1 through 9 recalls a previously saved
string. Any character, string or expression that is surrounded by
parentheses in the Find String (as described in previous section) can be
recalled by the replace pattern using the “\n” format. Since the
parentheses may be nested, the number “n” represents the order of the
groupings as defined by the order of the left parenthesis in the search
pattern.
Examples
Find String =
123(ABC)
Pass/Fail Replacement String =
\1
Incoming String =
123ABC456
Host Message =
ABC
The Find String above matches the incoming string. The Pass/Fail
Replacement String states that the string identified within the first
parentheses should be sent to the host.
Find String =
(123(ABC))
Pass/Fail Replacement String =
\1\2
Incoming String =
123ABC456
Host Message =
123ABCABC
The Find String above matches the incoming string. The Pass/Fail
Replacement String states that the string identified within the first
parentheses (123ABC), plus the string identified by the second
parentheses(ABC) should be sent to the host.
&
When the ampersand ( & ) indicates that the part of the string that
matches the Find String should be sent to the host. If the string contains
more characters than the Find String, then the additional characters are
discarded.
Examples
Find String =
123ABC
Pass/Fail Replacement String = &
Incoming String =
123ABC
Host Message =
123ABC
The Find String above matches the incoming string. The Pass/Fail
Replacement String states that the string identified in the Find String
should be sent to the host.
Find String =
123ABC
Pass/Fail Replacement String = &
Incoming String =
123ABC456
Host Message =
123ABC
The Find String above matches the incoming string. The Pass/Fail
Replacement String states that the string identified in the Find String
should be sent to the host. This does not include the digits 456.
Replacement String
Metacharacters