apoc.text.replace

Details

Syntax

apoc.text.replace(text, regex, replacement)

Description

Finds and replaces all matches found by the given regular expression with the given replacement.

Arguments

Name

Type

Description

text

STRING

The string to be modified.

regex

STRING

The regular expression pattern to replace in the original string.

replacement

STRING

The value to be inserted in the original string.

Returns

STRING

Usage Examples

RETURN apoc.text.replace('Hello World!', '[^a-zA-Z]', '') AS output;
Results
output

"HelloWorld"

RETURN apoc.text.replace('GDS is a Neo4j Product', 'GDS', 'Bloom') AS output;
Results
output

"Bloom is a Neo4j Product"