====== 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.
{{::string_between_initial.png?direct&600|}}
===== Parameters =====
The **String Between** function has three parameters, all of which are required:
==== Haystack ====
Allowed Inputs: [[Field|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|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|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('Lot Size: 140 acres
','Lot Size:','')
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('Lot Size: 140 acres
','Lot Size:\s','')
will return '140 acres';
For additional help with regular expressions try [[http://www.regular-expressions.info/|regular-expressions.info]]