Previous Topic: CommentsNext Topic: Transforms


Per Character Matching

By default, searches match against whole words. To enable a search to match against individual characters, use the following variables.

%# ... %

Matches the contained expression on a per character basis.

\a

Matches any single letter. See the examples below.

Example: %#\a\a123% matches GB123.

\d

Matches any single digit (0-9).

Example: %#GB\d\d\d% matches GB123.

Example: When %#ab{\d\d\a}[+g]% is matched against ab11a22d33f, it returns ab11a22d33f. The [+g] indicates 'greedy matching'.

Example: When %#{\d\a\d}|{\d\d\d} \d\d\??% is matched against Phone: 020 8686 3313 ; Id: 0a0 86bc, it returns 020 8686 and 0a0 86bc. The ?? wildcards match any character.

Example: When %#{\d[3,] }[3]% is matched against Phone: 020 8686 3313 ; Id: 0a0 86bc, it returns 020 8686 3313.

\l

Matches any single letter or digit.

\p

Matches any single punctuation character.

Example: %#cn\p\d\d\d \a\d% matches cn:123 A3 and cn-123 A3.

\f

Aborts all matching immediately for this expression.

?

Wildcard. Matches any single character. See Wildcards.

Space

A space in the search text expression matches spaces between words or other elements.

Example: {contact list} matches contact list.

Example: %#ID \d\d\d% matches ID 123.

Character ranges

[[a-z]]

Matches any character between a and z.

Example: When %#[[0-9]][4][[def]]% is matched against order: 7638f, it returns 7638f.

[[abc]]

Matches a or b or c.

Example: When %#[[0123456789]][4][[def]]% is matched against order: 7638f, it returns 7638f.

Example: %#[[0-9abcP-R]]% matches any single character that is either: a digit between 0 and 9; a or b or c; or any upper case letter between P and R.

[[^abc]]

Matches any character except a or b or c. Spaces are also excluded.

Example: When %#[0-9]][[^0-9]]% is matched against order: 0a 5u 12, it returns 0a 5u. The final element, 12, is excluded because the search text expression explicitly excludeds two consecutive digits.

More information:

Repeat Expressions

Subexpressions and Logical Operators

Matching Forwards and Backwards

User-defined Variables

You can search for specific text and, if found, assign that text to a custom variable. Any part of the matching text can be extracted and stored as a user-defined variable. You can then use the custom variable in smart tags and user notification messages.

Simple User-defined Variables

Use the following syntax to create custom variables.

%<MyVariable>%<search text>%</MyVariable>%

Matches any search text enclosed by the %<MyVariable>% tags and saves it to a variable %MyVariable%.

<MyVariable> can be any text. Variable names are case-sensitive. Variables must be terminated. That is, they must have a closing %</..>% tag.

<search text> can be any word or phrase, and can include other variables.

Example: %<User_ID>% %#\a\a\a\a\a\d\d#% %</User_ID >% detects any aaaaann identifier such as rimsp02 and saves it to a custom variable named %User_ID%.

Example: Here, the %<User_ID>% variable is incorporated into a user notification message: Your email has been blocked. It includes a reference to User %User_ID%.

Multiple and Overlapping User-defined Variables

You can create multiple user-defined variables from a single match, and variables can be overlapping. For example:

{Id = %<ID>% * %</ID>%}

When matched against Id = 1234, this search expression generates a single user-defined variable, %ID%. Its value is 1234.

{%<ALL>% Id = %<ID>% * %</ID>%%</ALL>% }

When matched against Id = 1234, this search expression generates two user-defined variables:

%ALL% has a value of Id = 1234.

%ID% has a value of 1234.

{%<START>%%<ALL>% Id %</START>% = %<ID>% * %</ID>%%</ALL>%}

When matched against Id = 1234, this search expression generates three user-defined variables:

%START% has a value of Id .

%ALL% has a value of Id = 1234.

%ID% has a value of 1234.