Hello,

As part of [CALCITE-2755](https://issues.apache.org/jira/browse/CALCITE-2755)
([982](https://github.com/apache/calcite/pull/982)) I needed to perform
regex comparison of result (since it is not known in advance).

The assertion looks like:

```java
assertThat()
.query("select id, a from view")
.returns(regexMatch("id=\\p{Graph}+; a=1"))
```
Do you think CalciteAssert might benefit from regular expressions ? Should
it support expressions natively or as standalone Consumer implementation ?
Should it also support [group capturing](
https://docs.oracle.com/javase/tutorial/essential/regex/groups.html) ? If
so, what is recommended syntax ?

### Syntax examples
```java
.returns(regexMatch("id=\\p{Graph}+; a=1")) // separate consumer
.returns("id=\\p{Graph}+; a=1") // native support
.returns("id=REGEX{\\p{Graph}+}; a=1") // special syntax
.returns("id=(\\p{Graph}+); a=$1-test") // group capturing ?
```

Regards,
Andrei.

Reply via email to