REGEX_EXTRACT
Returns an array of all the regex matches on the input text.
Optionally, include a string containing Ruby modifiers – e.g. i for case insensitive mode.
Categories: Text
Syntax
REGEX_EXTRACT(text, regex, [modifiers])
Examples
Example 1
Input
1
{
2
"my_action": {
3
"message": "The quick brown fox jumps over the lazy dog. It barked."
4
}
5
}
Formula
REGEX_EXTRACT(my_action.message, "[A-Z]")
Output
1
[
2
"T",
3
"I"
4
]
Example 2
Input
1
{
2
"example": "hello & HELLO"
3
}
Formula
REGEX_EXTRACT(example, "hello", "i")
Output
1
[
2
"hello",
3
"HELLO"
4
]
Example 3: Extracting multiple matching groups
Input
1
{
2
"my_action": {
3
"message": "see no evil, hear no evil, speak no evil"
4
}
5
}
Formula
REGEX_EXTRACT(my_action.message, "([a-z]+) no ([a-z]+)")
Output
1
[
2
[
3
"see",
4
"evil"
5
],
6
[
7
"hear",
8
"evil"
9
],
10
[
11
"speak",
12
"evil"
13
]
14
]
Example 4: A more complex example that extracts the first match and pipes it into another function.
Input
1
{
2
"my_action": {
3
"message": "This is an automatically generated message from Tines"
4
}
5
}
Formula
REGEX_EXTRACT(my_action.message, "(?<=This is)(.*)(?=generated)")[0][0] |> UPCASE(%)
Output
" AN AUTOMATICALLY "
Sample actions
Select an action to inspect
You can also click "Copy actions" and paste them in your Tines story to see how they work.
Select an action to inspect
You can also click "Copy actions" and paste them in your Tines story to see how they work.