## REPLACE

The `REPLACE` function substitutes any match of a regular expression within a string with a replacement string.

### Syntax

`REPLACE(string, regex, newString)`

#### Parameters

- `string`: String expression.
- `regex`: Regular expression.
- `newString`: Replacement string.

### Examples

Here are a couple of examples of how to use the `REPLACE` function in ES|QL queries:

```esql
ROW str = "Hello World"
| EVAL str = REPLACE(str, "World", "Universe")
| KEEP str
```

In this example, the `REPLACE` function is used to replace any occurrence of the word "World" with the word "Universe" in the string "Hello World".

```esql
ROW str = "Elasticsearch is awesome"
| EVAL str = REPLACE(str, "awesome", "fantastic")
| KEEP str
```

In this example, the `REPLACE` function is used to replace the word "awesome" with "fantastic" in the string "Elasticsearch is awesome".