v.23.4New Feature
Functions allow non-const patterns and replacements in replaceOne(), replaceAll(), replaceRegexpOne(), and replaceRegexpAll()
Functions replaceOne(), replaceAll(), replaceRegexpOne() and replaceRegexpAll() can now be called with non-const pattern and replacement arguments. #46589 (Robert Schulze).
Why it matters
This feature allows users to provide dynamic patterns and replacements when using these string replacement functions, enabling more flexible and powerful text manipulations within queries.How to use it
Simply call the functionsreplaceOne(), replaceAll(), replaceRegexpOne(), or replaceRegexpAll() with non-constant expressions for the pattern and replacement parameters, for example:SELECT replaceAll(column, dynamic_pattern, dynamic_replacement) FROM table