Skip to content

REGEXMATCH

Dan Gorman edited this page Nov 29, 2018 · 2 revisions

The REGEXMATCH Function

Function Group: Text

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

Syntax

REGEXMATCH(arg1, arg2)

  • arg1 is a string to be searched
  • arg2 is the regex pattern to be searched for

Uses

Let's say we're given a response with some vehicle information that looks like this:

{  
   "data":{  
      "mechanic_reports":{  
         "vehicle_1":{  
            "description":"The car was still functional, but had a bad radiator, and was in bad condition."
         }
      }
   }
}

If we want to know whether a specific part has been mentioned,for instance, "radiator" or "radiators":

REGEXMATCH(data.mechanic_reports.vehicle_1.description, "radiator.")

This will return true, because the regex was matched.

Clone this wiki locally