RegExp in Legend Format

Im trying to see if there is any way I can use a RegExp in a Legend format, Its actually related to a redistribution instance in test where we are assigning a db from the REDIS to each test env, so we get DB1, DB2 and so on
Those are actually related to env names, so I want legend o display for example stagingEnv if the db is DB1 , UATEnv if DB2 and so on
Doesn’t look like its possible but thought would ask if anyone has an idea ?

Cheers all

What data source are you using?

Yes sorry should have said, I’m using prometheus

Unfortunately there is no regex support for Legend format. There is a PR for adding filter support for Legend Labels but it is waiting on changes before merging.

Thanks for the note and the link, appreciate it !