Thanks, que, for adding this as a bug also: [How to use regexp in @filter]: <regexp use> · Issue #8996 · dgraph-io/dgraph · GitHub . We need to fix this to make things easy to use.
Meantime, I suggest using some rewriter as a workaround. How do you currently build the DQL, and is there an intermediate form of the query?
Parsing the DQL is harder but possible (simply find regexp(…) in the filter and swap it with func:somefunc(…) in the root query in text. If you post that script to the community it would be helpful.
If you have a query layer above with a list of conditions or an AND/OR tree structure or similar, it would be easier to programmatically ensure the longest regexp is used as func:regexp() at root.