apoc.text.replaceFunctionDeprecated in Cypher 25
|
This function is deprecated.
Use Cypher’s |
Syntax |
|
||
Description |
Finds and replaces all matches found by the given regular expression with the given replacement. |
||
Arguments |
Name |
Type |
Description |
|
|
The string to be modified. |
|
|
|
The regular expression pattern to replace in the original string. |
|
|
|
The value to be inserted in the original string. |
|
Returns |
|
||
Usage Examples
The following returns the string with all matches of the regular expression replaced by the replacement string using both APOC and Cypher:
apoc.text.replace
RETURN apoc.text.replace('Hello World!', '[^a-zA-Z]', '') AS output;
Using Cypher’s string.regexReplace
RETURN string.regexReplace('Hello World!', '[^a-zA-Z]', '') AS output;
| output |
|---|
"HelloWorld" |
apoc.text.replace
RETURN apoc.text.replace('GDS is a Neo4j Product', 'GDS', 'Bloom') AS output;
Using Cypher’s string.regexReplace
RETURN string.regexReplace('GDS is a Neo4j Product', 'GDS', 'Bloom') AS output;
| output |
|---|
"Bloom is a Neo4j Product" |