Grafana v9 Variable Regex Pattern

We recently upgraded from Grafana v8.1.2 to Grafana v9.4.1.

In version v8, a regex pattern for variables was something like ^(abc-). At least that’s the format we used and it works.

In version v9, the regex pattern is now surrounded by forward slashes. The v8 pattern now becomes /^(abc-)/. It appears the forward slashes are required - as soon as I add them to the regex pattern, I get values. Without the forward slashes I do not get values.

I would have expected on the first start-up of v9, the conversion process would have corrected the regex patterns used in variables. It did not.

Is there a way to mass change the regex patterns in variables for all of our dashboards?


hi @kekruppa
welcome to the :grafana: community

I don’t think this is configurable. The regex type is based on Golang, just as the backend code is.

You can use a regex calculator to calculate your regular expressions in that flavour

Thanks Antonio. I am asking if there is a way to do a mass change to add a / to the front and end of the variable regex patterns used in our dashboards. I am not wanting to change the pattern Grafana requires.