Find Text Action

Description

Finds each or every occurrence of a text pattern and places the result into a variable.  Regular expressions may be used for added power and flexibility. Used to locate a word or phrase inside of a larger piece of text.

Declaration

<AMFINDTEXT TEXT="text" FIND="text" RESULTVARIABLE="text [variable name]" USERE="yes/no" USECASE="yes/no" INDEX="number" FOUNDTEXTVAR="text [variable name]" TOTALMATCHESVAR="text [variable name]">

Example

<AMVARIABLE NAME="index"></AMVARIABLE>
<AMFINDTEXT TEXT="Finds each or every occurrence of a text pattern and places the result into a variable.  Regular expressions may be used for added power and flexibility." FIND="occurrence" RESULTVARIABLE="index">
<AMMESSAGEBOX>The word 'occurrence' was found at position: %index%</AMMESSAGEBOX>

General Tab Parameters

Text: Specifies target text to be searched.

Text, Required
MARKUP: TEXT="My name is Joe"

Find: Specifies the text to search for.

text,Required, Required
MARKUP: FIND="name"

Case Sensitive: Specifies whether the search performed should be case sensitive.

Yes/No, Optional (default: No)
MARKUP: USECASE="YES"

Regular Expression: Specifies whether the FIND parameter is a regular expression. If the option is no, the Find parameter contains literal text, if the option is yes, the find parameter contains a regular expression.

Yes/No, Optional (default: No)
MARKUP: USERE="YES"

Populate variable with first index: Specifies the variable to receive the position of the text if found.

Text [variable name], Required
MARKUP: RESULTVARIABLE="varname"

Advanced Tab

Starting at the following instance: Specifies target text to be searched. Click the Expression Builder icon to build and insert a variable or expression.

Number, Optional (default: 1)
MARKUP: INDEX="5"

Total find count into variable: Specifies the variable to receive the total instances found.

Text [variable name], Required
MARKUP: TOTALMATCHESVAR="varname"

Populate variable with found text: Specifies the variable to receive the text that was found. This parameter is useful if a regular expression was used for the find text.

Text [variable name], Required
MARKUP: FOUNDTEXTVAR="varname"