---
title: "gsql_regex_replace()"
component: "gsql-ref"
version: "4.3"
module: "ddl-and-loading"
html_url: "/gsql-ref/4.3/ddl-and-loading/functions/token/gsql_regex_replace"
canonical_url: "https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token/gsql_regex_replace"
markdown_url: "https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token/gsql_regex_replace.md"
---

[View as HTML](https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token/gsql_regex_replace)

# gsql_regex_replace()

Returns the string resulting from replacing all substrings in the input string that match the given regex token with the substitute string.

## Syntax

`gsql_regex_replace(str, regex, replace_substr)`

## Parameters

str

Required. The original string.

regex

Required. The regex for the original string to match against.

replace\_substr

Required. The substring to replace all instances of substrings that match the provided regex.

## Return type

`STRING`

## See also

* [gsql\_replace()](https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token/gsql_replace.md)
