Flink SQL REGEXP_REPLACE Does Not Support Capturing Groups

58 views Asked by At

Given:

 select REGEXP_REPLACE('ERR1,ERR2', '([^,]+)', 'AA$1AA');

The result is: AA$1AA,AA$1AA

Is it supported at all (not mentioned in docs) or possible I'm using it incorrectly?

Thanks in advance

1

There are 1 answers

5
David Anderson On

Flink SQL uses Java's String.replaceAll to implement REGEXP_REPLACE. It seems like $1 should work, but it doesn't.

I've created https://issues.apache.org/jira/browse/FLINK-34477 to report and track this.