Formula - replaceregex
Replace text using regular expressions in messages with the Nodinite replaceregex Formula plugin. This page shows how to substitute patterns in message Content, Context, or the output of other formulas. This text replacement tool uses pattern matching to transform data across your integration landscape.
Designed for business users and integrators — no developer required; you can even use AI to craft expressions.
- Replace patterns from any Payload or Context in any Log Event
- Use any valid regular expression to match and replace patterns
- 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 replaceregex Formula do?
The replaceregex('Pattern', 'NewValue', Content) Formula function substitutes all occurrences of a pattern (matched by regular expression) with a new value. Use it on message bodies, context values, or the results from other Formula functions to transform data in your views. This Search Field Expression enables powerful data transformation for compliance, troubleshooting, and reporting.
How it works: Input ➜ replaceregex ➜ Result
Flow: The content is processed with a regular expression to replace all matched patterns with the new value.
Syntax
Replace pattern in message body: (See Example 1)
replaceregex('Pattern', 'NewValue', body)
Replace pattern in message context: (See Example 2)
replaceregex('Pattern', 'NewValue', context('MessageContextKey'))
Replace pattern in nested formula: (See Example 3)
replaceregex('Pattern', 'NewValue', jsonpath('$.path', body))
Common regex patterns:
replaceregex('[0-9]', 'X', body) # Replace all digits with X
replaceregex('\\d+', 'REDACTED', body) # Replace numbers with REDACTED
replaceregex('DELETE', 'UPDATE', body) # Replace DELETE with UPDATE
replaceregex('[A-Z]{3}', 'XXX', body) # Replace 3-letter uppercase codes
Example data
<TypedPolling xmlns="http://schemas.microsoft.com/Sql/2008/05/TypedPolling/INT007">
<TypedPollingResultSet0>
<TypedPollingResultSet0>
<ProjectNumber>1401518</ProjectNumber>
<Company>400</Company>
<Activity>1000</Activity>
<Version>20250301060028</Version>
<Action>DELETE</Action>
</TypedPollingResultSet0>
<TypedPollingResultSet0>
<ProjectNumber>1401518</ProjectNumber>
<Company>400</Company>
<Activity>1001</Activity>
<Version>20250301060028</Version>
<Action>DELETE</Action>
</TypedPollingResultSet0>
<TypedPollingResultSet0>
<ProjectNumber>4831351</ProjectNumber>
<Company>355</Company>
<Activity>1063</Activity>
<Version>20250301060028</Version>
<Action>DELETE</Action>
</TypedPollingResultSet0>
<TypedPollingResultSet0>
<ProjectNumber>9233120</ProjectNumber>
<Company>700</Company>
<Activity>3400</Activity>
<Version>20250301060028</Version>
<Action>DELETE</Action>
</TypedPollingResultSet0>
<TypedPollingResultSet0>
<ProjectNumber>9402000</ProjectNumber>
<Company>734</Company>
<Activity>5104</Activity>
<Version>20250301060028</Version>
<Action>DELETE</Action>
</TypedPollingResultSet0>
</TypedPollingResultSet0>
</TypedPolling>

Example of the replaceregex formula function in the Nodinite UI
Examples
Example 1: Replace all numbers with X
Input
Message body contains:
<ProjectNumber>1401518</ProjectNumber>
Formula Expression
replaceregex('[0-9]', 'X', body)
Result
<ProjectNumber>XXXXXXX</ProjectNumber>
Example 2: Replace DELETE actions with UPDATE
Input
Message body contains:
<Action>DELETE</Action>
Formula Expression
replaceregex('DELETE', 'UPDATE', body)
Result
<Action>UPDATE</Action>
Example 3: Replace company codes with placeholder
Input
Message body contains:
<Company>400</Company>
Formula Expression
replaceregex('<Company>[0-9]+</Company>', '<Company>XXX</Company>', body)
Result
<Company>XXX</Company>
Features
- Replace patterns using any valid regular expression in any Content
- Works with message body, context, or results from other Formula functions
- Combine with other Formula functions for powerful, layered expressions
- Use in Log Views for filtering, grouping, and self-service diagnostics
Important
The replaceregex plugin loads the entire message into RAM. Only use this function on small messages to avoid performance issues.
How to use the replaceregex Formula
- Select Formula as the expression type plugin.
- Enter your replaceregex expression in the 'Expression' text area.
- See Syntax section above for common patterns and usage examples.
Next Step
How to Add or manage Search Fields
How to Add or manage Log Views
Related Topics
- What is Formula?
- replace - Simple string replacement (no regex)
- concat - Join multiple strings together
- substring - Extract part of a string
- jsonpath - Extract data from JSON
- xpath - Extract data from XML
- Expression Type Plugins are used in Search Fields
- What are Search Field Expressions?
- What are Log Views?