String operations
Use dynamic expressions to modify and verify data in strings. If your string contains special characters, you have to escape them. You can also use dynamic expressions with string operations.
Available string operations
The following string operations are available in Engines 3.0:
Expression |
Description |
Example |
Result |
---|---|---|---|
{BASE64} Syntax: {BASE64[InputText][Parameter]} |
Parameter ENCODE encodes the string to Base64 format, parameter DECODE decodes the Base64 string. |
{BASE64[Hello][ENCODE]} |
SGVsbG8= |
{NUMBEROFOCCURRENCES} Syntax: {NUMBEROFOCCURRENCES[InputText][Pattern][Optional parameter]} |
Counts all occurrences of the defined input or pattern. You can use any regular expression for the property [Pattern].
|
{NUMBEROFOCCURRENCES[Mississippi][ss]} |
2 |
{STRINGLENGTH} Syntax: {STRINGLENGTH[InputText]} |
Counts the number of characters in the string. |
{STRINGLENGTH[Nice2MeetU]} |
10 |
{STRINGREPLACE} Syntax: {STRINGREPLACE[InputText][Pattern][NewValue][Optional parameter1, Optional parameter2]} |
Replaces all occurrences of a defined input or pattern with a new defined value.
You can use any regular expression for the property [Pattern]. |
{STRINGREPLACE[WeekEnd][e][x][IGNORECASE]} |
Wxxkxnd |
{STRINGSEARCH} Syntax: {STRINGSEARCH[InputText][Pattern][Optional parameter1, Optional parameter2]} |
Searches for a specific pattern in a text and returns all matching results.
You can use any regular expression for the property [Pattern]. |
{STRINGSEARCH[WeekEnd][e][IGNORECASE]} |
e;e;E |
{STRINGTOLOWER} Syntax: {STRINGTOLOWER[InputText]} |
Converts uppercase characters in the string to lowercase characters. |
{STRINGTOLOWER[Nice Day]} |
nice day |
{STRINGTOUPPER} Syntax: {STRINGTOUPPER[InputText]} |
Converts lowercase characters in the string to uppercase characters. |
{STRINGTOUPPER[Nice Day]} |
NICE DAY |
{TRIM} Syntax: {TRIM[InputText][Optional Parameter]} |
Removes whitespace characters from the start or the end of the string, or both:
|
{TRIM[ no starting space ][START]} |
no starting space |
String operations with regular expressions
To see whether the target attribute contains a particular string, use regular expressions for the property [Pattern]. This means you can use \t, \n, \r and the special characters ^, [,(, {, +, ?, |, \, $, ., and * to build your regular expressions.
Note that if you want to use these special characters as part of a text in your regular expression, you need to escape them.
String operations with dynamic expressions
You can use string operations with specific text-based dynamic expressions.
This allows you, for example, to include buffers, date and time expressions, and random numbers in a string operation. For more details on specifying dynamic values, check out Value expressions.
To use string operations with dynamic expressions, replace the respective [InputText] of a string operation with the desired dynamic expression.