REReplace()
Uses a regular expression (RE) to search a string for a string pattern and replace it with another.
The search is case-sensitive.
REReplace( string=string, regex=string, substring=string, scope=string );
Returns: String
Examples
writeDump(rereplace("xxabcxxabcxx","ABC","def"));
writeDump(REReplace("CABARET","C|B","G","ALL"));
writeDump(REReplace("CABARET","[A-Z]","G","ALL"));
writeDump(REReplace("I love jellies","jell(y|ies)","cookies"));
writeDump(REReplace("I love jelly","jell(y|ies)","cookies"));
writeDump(REReplace("hello john how are you:", "['[:space:]']+", "_", "ALL"));
See also
- Strings
- Regex
- string.rEReplace()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)