Locate the position (0-based index) of the first substring that matches a regular-expression pattern within a string.
Note
See also Regular expressions (regex) .
{{regexSearch field regex [options]}}
-
field – Text field or variable to search (e.g.,
record.total). -
regex – Regular-expression pattern.
-
options(optional) – Regex flags such as
"i"(case-insensitive) or"m"(multiline).
The helper returns the numeric index of the match, or -1 when the pattern is not found.
-
Locating a character in a price
{{regexSearch record.total "5"}}If
record.totalis"$1499.95", the helper returns7(the “5” is the eighth character). -
Finding the decimal point
{{regexSearch record.total "\."}}Returns
5for"$1499.95"—the"."is at index 5. -
Case-insensitive search in notes
{{regexSearch record.comment "celigo" "i"}}With
record.comment = "HELLO Celigo", the helper returns the index of"Celigo"even though the case differs.
Tip
-
The index is zero-based (
0,1,2, …). -
If no match is found, expect
-1and handle that outcome in subsequent mappings. -
Triple braces (
{{{ }}}) are usually unnecessary here—the helper returns a plain number that is not subject to Celigo’s automatic string formatting.