Query Manipulation Server 26.2
Query Manipulation Server Help

# regex_replace_all

Searches a string for matches to a regular expression, and replaces the matches according to the value specified by the `replacement` argument.

## Syntax

    regex_replace_all( input, regex, replacement )

## Arguments

Argument | Description
--- | ---
`input` | (string) The string in which you want to replace values.
`regex` | (string) The regular expression to use to find values to be replaced.
`replacement` | (string) A string that specifies how to replace the matches of the regular expression.

## Returns

(String). The modified string.

## Examples

    regex_replace_all("ABC ABC ABC", "AB", "A")
    -- returns "AC AC AC"

    regex_replace_all("One Two Three", "\\w{3}", "_")
    -- returns "_ _ _ee"

    regex_replace_all("One Two Three", "(\\w+) (\\w+)", "\\2 \\1")
    -- returns "Two One Three"

Copyright 2026 Open Text
Version 26.2 | Last updated April 2026

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery Query Manipulation Server 26.2

Topic Title: regex_replace_all