Variable / Regex in query editor


I am requesting an influx Database based on the field and measurement directly selected from panel variables shown as drop downs (result from query on the DB).

From the example shown in the picture I get the following query :

SELECT “A”,“B”,“C” FROM “Measurement 1” WHERE time >= now() - 1h

However I would like my query to be :

SELECT mean(“A”), mean(“B”), mean(“C”) FROM “Measurement 1” WHERE time >= now() - 1h

Can this be directly handled using regex in the query editor ?
I have read the documentation on regex and tried many options, however I fail to succeed processing the query, any hint on what syntax could be ?

Thanks :slight_smile: