- 2 minutes to read

Formula - regex

Easily extract values from messages using the Nodinite regex Formula plugin. This page shows you how to use regular expressions to retrieve data from message content, context values, or results from other formulas for your integrations.

✅ Extract single or multiple values using any valid regular expression
✅ Use simple expressions to transform message content or context
✅ See clear, real-world examples with input, formula, and result


What does the regex Formula do?

The regex('Expression', Content) Formula function extracts values from text using any valid regular expression. You can use this function on message bodies, context values, or results from other formulas.


Example 1: Extracting a Number from Message Body

Input from body

This is number 5

Formula Expression

regex('\d+', body)

Result

5

regex_simpleParameter
Example: Extracting a number from message body using regex


Example 2: Extracting a Value from Message Context

Suppose you have a message context value with the key id containing GMT.

Input

GMT

Formula Expression

regex('GMT|UTC', context('id'))

Result

GMT

RegEx Message Context
Example: Extracting a value from message context using regex


Example 3: Extracting Multiple Values from Nested Context

Suppose you have multiple context keys, each with text values.

Input

GMT UTC
GMT CTO

Formula Expression

regex('UTC|CTO', context(regex('id.*')))

Result

UTC
CTO

RegEx Message Context Nested Function
Example: Extracting multiple values from nested context using regex


Features

  • Extract single or multiple unique values from any Content using regular expressions
  • Works with message body, context, or results from other Formula functions
  • Ensures data integrity across integrated systems

Important

The regex plugin loads the entire message into RAM. Only use this function on small messages to avoid performance issues.


How to use the regex Formula

  1. Select Formula as the expression type plugin.
  2. Enter your regex expression in the 'Expression' text area.
  3. Provide a string as the Content parameter (e.g., message body, context value, or another formula result).

Syntax

  • Extract from message body:
    regex('Expression', body)
  • Extract from message context:
    regex('Expression', context('MessageContextKey'))
  • Extract from another formula:
    regex('Expression', SomeOtherNestedFormulaFunction(Content))

Next Step

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