REGEXMATCH

REGEXMATCH returns a Boolean value determined by whether a provided regex can be matched within a string.

Function category: Text

Syntax

REGEXMATCH(arg1, arg2)

Arguments

Description

arg1

String to be searched.

arg2

regex pattern used to do the search.

Examples

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."
}
}
}
}

If we want to know whether a specific part has been mentioned, for instance, "radiator" or "radiators" using REGEXMATCH. In this example, we search using "radiator.".

# Search for radiator
REGEXMATCH(data.mechanic_reports.vehicle_1.description, "radiator.")
# Returns true
# As "radiator" was found, regex matched