Case insensitive regex in variable

Hi, I’m using a regex in a dashboard variable with a Cloud Flare data source. Grafana version 10.0.0.

I need the regex to be case insensitive but haven’t managed to get it to work using options like “/gi” or “/i“ at the end or “(?i)” before the variable. e.g.

^(.(?i)${environment}.(wss|auth).*)$

Typical variable values are: Production, production, staging, Staging

They all result in invalid regular expression template errors.

Image below. Specially i need the ${environment} variable part to be case insensitive.

Can anyone help?

Apparently Grafana is based on the Go template which is not compatible with (?i) or /i flags.
I used this format [tT][eE][sS][tT] basically it means any combination of letters, one from every [] (test, Test, TEST, TeSt, etc.)