Find 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. Mainly used to locate a word or phrase inside of a larger piece of text.

Declaration

<AMFINDTEXT TEXT="text(target text)" FIND="text(text to find)" RESULTVARIABLE="text" USERE="YES/NO" USECASE="YES/NO" FOUNDTEXTVARIABLE="text" TOTALMATCHESVARIABLE="number" />

See Also: Get Subtext, Insert Text, Pad Text, Replace Text, Trim Text, Format Date/Time, Convert Case, Pad Text

General Tab

Property

Type

Required

Default

Markup

Description

Text

Text

Yes

(Empty)

TEXT="My name is Joe"

The target text to be searched. As with every text parameter, if the data you want to enter is contained in a variable, enter the variable name surrounded by percentage signs to resolve it to it's contents at runtime (i.e. %VarName%).

Find

Text

Yes

(Empty)

FIND="name"

The text to search for.

Case Sensitive

Yes/No

No

No

USECASE="YES"

Specifies whether the search performed should be case sensitive. If set to YES, the search is case sensitive. This parameter is set to NO by default.

Regular Expression

Yes/No

No

No

USERE="YES"

Specifies whether the Find parameter is a regular expression. If set to NO (default), the Find parameter contains literal text. If set to YES, the Find parameter contains a regular expression.

Populate variable with first index

Text

Yes

(Empty)

RESULTVARIABLE="varname"

The variable to receive the first position of the text, if found.

Attributes Tab

Property

Type

Required

Default

Markup

Description

Starting at the following instance

Number

No

1

INDEX="2"

Indicates that the target text should be searched starting at the following instance.

Total Find Count into Variable

Text

No

(Empty)

TOTALMATCHESVARIABLE="varname"

The variable to receive the total instances found.

Populate Variable with found text

Text

No

(Empty)

FOUNDTEXTVARIABLE="varname"

The variable to receive the text that was found. This parameter is useful if a regular expression is used to find text.