- 0 minutes to read

Formula - regexgroup

Easily extract values from messages using the Nodinite regexgroup Formula plugin. This page shows how to use regular expressions and group identifiers to retrieve data from message Content, body, Context, or the output of other formulas.

🎯 Designed for business users and integrators β€” no developer required; you can even use AI to craft expressions.

  • βœ… Extract single or multiple values using any valid regular expression group from any Payload or Context in any Log Event
  • βœ… Flexible pattern matching with capture groups to isolate specific data segments
  • βœ… Transform and surface meaningful data in Nodinite Log Views, search filters, and self-service diagnostics
  • βœ… Combine with other Formula functions for powerful, layered expressions

What does the regexgroup Formula do?

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


How it works: Input ➜ regexgroup ➜ Result

graph LR A["Input: Text with patterns"] --> B["regexgroup('pattern', groups, Content)"] B --> C["Result: Extracted group values"]

Flow: The text content is matched against the regex pattern, and specified capture groups are extracted.


Examples

Below are practical examples showing how to extract capture group values from different sources.

Example 1: Extracting Groups from Message Body

Input - Example 1

ID=123,CUSTOMER=1
ID=456,CUSTOMER=2

Formula Expression - Example 1

regexgroup('ID=(\d+)', '1', body())

Result - Example 1

123
456

RegEx Group Simple Parameter
Example: Extracting group values from message body using regexgroup


Example 2: Extracting a Group from Message Context

Suppose you have a message context value with the key OrderRecord containing pipe-delimited order data.

Input - Example 2

ORD|101|ExampleCompany1|456|Company Name ACME |Dieselgate valley 1|123 45|Flameburg|

Formula Expression - Example 2

regexgroup('^(?:(.*?)\|){4}', '1', context('OrderRecord'))

Result - Example 2

456

RegEx Group Message Context
Example: Extracting a group value from message context using regexgroup


Features

The regexgroup Formula function is highly flexible and can be nested with other formula functions. For instance, combine it with concat or replace to manipulate the extracted values before using them in a Search Field.

  • Extract single or multiple unique values from any Content using regular expression capture groups
  • Supports extracting specific groups or ranges (e.g., 1, 1,3, or 1-5)
  • Works with message body, Context, or results from other Formula functions
  • Ensures data integrity across integrated systems

Important

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


How to use

The regexgroup formula extracts values from text using regular expression capture groups. It's ideal for isolating specific data segments from structured or semi-structured text.

Syntax

regexgroup('Expression', groups, Content)

Parameters:

  • Expression (string): A regular expression pattern with capture groups, e.g., 'ID=(\d+)'
  • groups (string): The group(s) to extract β€” can be a single number ('1'), comma-separated ('1,3'), or a range ('1-5')
  • Content (string): The text content to search, typically from body() or context()

Example patterns:

  • 'ID=(\d+)' with group '1' – Extract numeric IDs
  • '^(?:(.*?)\|){4}' with group '1' – Extract the 4th pipe-delimited field
  • '(\w+)@(\w+\.\w+)' with groups '1,2' – Extract username and domain from email

Extract from different sources:

  • Extract from message body: regexgroup('ID=(\d+)', '1', body())
  • Extract from message context: regexgroup('(\w+)', '1', context('MessageContextKey'))
  • Extract from another formula: regexgroup('(\d+)', '1', jsonPath('$.data.field', body()))

Next step