REGEXEXTRACT
finds the first appearance of a string within a block of text.
Function category: Text​
REGEXEXTRACT(arg1, arg2)
Arguments | Description |
| String to be searched. |
| Regex pattern to search. |
Let's say we're given a response with the following vehicle information.
{"data":{"mechanic_reports":{"vehicle_1":{"description":"The car was still functional, but had a bad radiator, and was in bad condition."}}}}
If we know that the attribute description
has a standard form and uses standardized terminology, we can do a search for a string using REGEXEXTRACT
. In this example we search for the string functional using ".unctional"
.
# Search for the first occurance of a stringREGEXEXTRACT(data.mechanic_reports.vehicle_1.description, ".unctional")​# Returns functional# The string ".unctional" was found
In this example we search for the string functional using ".uto"
.
# Search for the first occurance of a stringREGEXEXTRACT(data.mechanic_reports.vehicle_1.description, ".uto")​# Returns null# The string ".uto" was not found