# Variable / Regex in query editor

**URL:** <https://community.grafana.com/t/variable-regex-in-query-editor/51209>\
**Category:** InfluxDB\
**Created:** [July 30, 2021, 8:16am UTC](https://community.grafana.com/t/variable-regex-in-query-editor/51209 "2021-07-30T08:16:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![emilienlegrand](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@emilienlegrand](https://community.grafana.com/u/emilienlegrand)\
**Post date:** [July 30, 2021, 8:16am UTC](https://community.grafana.com/t/variable-regex-in-query-editor/51209/1 "2021-07-30T08:16:25Z")

</div>

Hello,

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).

 ![regex](https://us1.discourse-cdn.com/grafana/original/3X/5/b/5b43186eaac96b87b5ec6cc26a4cafb6bbe2b42a.jpeg)

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 🙂
