- 2 minutes to read

Formula - regex

The regex('Expression','Content') Formula function implemented Regular Expression as it is implemented everywhere. In other words, as long as the first parameter of the regex('Expression','Content') is a valid Regular Expression the function will return the matched result.

Quick example

Let's get you started with the following example: For other, and more advanced examples please scroll down on this page to the Examples section.

Input Expression Result

 This is number 5


Text Data regex expression Unique values


  • Extract single or multiple unique values from Content.
  • Use any valid RegEx expression.
  • Can be applied on any Content; Like jsonpath, xpath functions, review Formula user guide for the complete list of functions.

This plugin loads the entire message into RAM, so make sure to apply this function only on small messages.

How to use

To use the regex function we have to configure the Formula plugin:

  • Select Formula as the expression type plugin.
  • Write down the expression to use in the 'Expression' text area.
  • Input proper Content as a parameter to the function.


Use the regex function with any of the following parameters:

  • From Message Body: regex('Expression',body)

  • From Message Context: regex('Expression',context('id'))

  • Result from previous Formula operation regex('Expression',SomeOtherNestedFormulaFunction(Content))


Below you will find different common examples of how to use the regex function.

Body as Content

The body is a text "This is number 5", by using the provided expression, the result is 5.

e.g. regex('\d+',body)

Message Body

  This is number 5



Context as Content

The Message context value is normal text "GMT" and the key is "id", by using the provided expression, the result is GMT

e.g. regex('GMT|UTC',context('id')) RegEx Message Context

Message Context Value




Formula Function as Content

The Message Context value is normal text, we applied regex function on Key field to get multiple values and return list of matches, by using the provided expression, the result is UTC, CTO.

e.g. regex('UTC|CTO',context(regex('id.*'))) RegEx Message Context Nested Function

Message Body





Next Step

How to Add or manage Search Fields
How to Add or manage Log Views

Expression Type Plugins are used in Search Fields
What are Search Fields?
What are Search Field Expressions?
What are Message Types?
What are Log Views?