xccui commented on a change in pull request #6450: [FLINK-9991] [table] Add regexp_replace supported in TableAPI and SQL URL: https://github.com/apache/flink/pull/6450#discussion_r216951006
########## File path: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/functions/ScalarFunctions.scala ########## @@ -205,6 +206,26 @@ object ScalarFunctions { new String(data) } + + /** + * Returns a string resulting from replacing all substrings + * that match the regular expression with replacement. + */ + def regexp_replace(str: String, regex: String, replacement: String): String = { Review comment: Why not using `str.replaceAll()` here? Besides, I think the `replacement` string should be preprocessed with `Matcher.quoteReplacement()`. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services