between_strings
{{between_strings text string_delimiter_start string_delimiter_end flags="irxt"}}
Description
Returns a string which is the subset of text between string_delimiter_start and string_delimiter_end and not including string_delimiter_start or string_delimiter_end themselves.
If either string_delimiter_start or string_delimiter_end is not present in text, returns an empty string.
If either string_delimiter_start or string_delimiter_end is empty, throws an exception.
Arguments
text
The input string.
string_delimiter_start
The starting boundary string.
string_delimiter_end
The ending boundary string.
flags
itreat delimiter as not case-sensitive (default is case-sensitive)rsplit text at last instance ofstring_delimiter_startand last instance ofstring_delimiter_endinstead of the firstxexpand located text: use the first found instance ofstring_delimiter_startand the last found instance ofstring_delimiter_endttrim the final result prior to returning (remove all whitespace from beginning and end)
Examples
For the following examples, assume that
email.bodycontains:
This is red and that is blue and that is green.
Example 1: Return text between first instance of string_delimiter_start and first instance of string_delimiter_end
{{between_strings email.body 'is' 'is' flags='t'}}
The above example will output:
red and that
Example 2: Return text between first instance of string_delimiter_start and last instance of string_delimiter_end (expanded flag)
{{between_strings email.body 'is' 'is' flags='tx'}}
The above example will output:
red and that is blue and that
Example 3: Return text between last instance of string_delimiter_start and last instance of string_delimiter_end (reverse flag)
{{between_strings email.body 'is' 'is' flags='tr'}}
The above example will output: