---
title: REGEX_REPLACE
url: https://www.tines.com/docs/formulas/functions/regex-replace/
kind: formula-function
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/docs/llms.txt) › [Formulas](https://www.tines.com/llm/docs/formulas.md) › [Functions](https://www.tines.com/llm/docs/formulas/functions.md)*

# REGEX_REPLACE

*[View on tines.com](https://www.tines.com/docs/formulas/functions/regex-replace/)*

Replaces every occurrence of a regex match in text with the second argument.

**Categories:** Text

## Syntax

```
REGEX_REPLACE(text, regex, replacement)
```

## Examples

### Example 1

Input:

```json
{
  "my_action": {
    "message": "hello hello!"
  }
}
```

Formula:

```
REGEX_REPLACE(my_action.message, "h\w+", "goodbye")
```

Output:

```json
"goodbye goodbye!"
```

## Sample actions

```json
{
  "standardLibVersion": "14",
  "actionRuntimeVersion": "3",
  "agents": [
    {
      "disabled": false,
      "name": "My Action",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "message": "hello world!"
        }
      },
      "position": {
        "x": 3090,
        "y": 4170
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "REGEX_REPLACE",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "regex_replace": "=REGEX_REPLACE(my_action.message, \"\\w+\", \"goodbye\")"
        }
      },
      "position": {
        "x": 3090,
        "y": 4260
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 0,
      "receiverIdentifier": 1
    }
  ],
  "diagramNotes": []
}
```
