Skip to content

#regexReplace

Returns the string with all matches of a regular expression replaced with another value.

#regexReplace(value, pattern, replacement)
Category StringsValid in Property value
Name Type Description
value path | string The string to search.
pattern string A .NET regular expression.
replacement string The replacement text.

string

source.json
{
"code": "a1b2"
}
transformer.json
{
"result": "#regexReplace($.code, '[0-9]', '_')"
}
output.json
{
"result": "a_b_"
}

Try it in the playground →

#replace · #isRegexMatch