String Between (Expression Function)

Purpose

The String Between function (STRING_BETWEEN) is used to extract of substring from a larger string that is found between the start and end strings. These start and end strings to search for can contain regular expressions.

Parameters

The String Between function has three parameters, all of which are required:

Haystack

Allowed Inputs: field value or text string

The first parameter of the String Between function is the string to extract from. Use the Query Builder to choose a field that contains the value.

Start

Allowed Inputs: field value or text string

The second parameter is the string to search for to start the extraction. It can either be obtained from a field using the Query Builder or from a literal string. This part of the haystack is not returned.

End

Allowed Inputs: field value or text string

The third parameter is the string to search for to end the extraction. It can either be obtained from a field using the Query Builder or from a literal string. This part of the haystack is not returned.

Output

The output of the String Between function is the string that starts just after the Start parameter, and ends just before the End parameter.

Example

STRING_BETWEEN('<div>Lot Size: 140 acres</div>','Lot Size:','</div>')

will return ' 140 acres'.

To eliminate the extra white space before the 140 we can add a regular expression character match that will match for whitespace. Therefore:

STRING_BETWEEN('<div>Lot Size: 140 acres</div>','Lot Size:\s','</div>')

will return '140 acres';

For additional help with regular expressions try regular-expressions.info

expression function - string between.txt · Last modified: 2016/09/14 14:19 (external edit)
Copyright WorkXpress, 2020