What regex flavor used by Grafana

Hello,

What flavor of regex does grafana use? Or does it not matter. I always test my regex on this site

Not sure which flavor I need to select to test out my grafana regex

Thanks

Hi @yosiasz,

Thanks for opening this post.

The regex type is based on Golang as the backend code is written in Go while the Frontend is in Typescript. You are using the right one to test out regex via that website and just select Golang as flavour.

I hope this answer your question.

2 Likes

Yes it does answer my question! Why is though when I copy a working regex from regex101 site, it doesn’t work on Grafana?
Trying to get domain name from a list of emails

1 Like

@yosiasz - Go, hence Grafana uses RE2 regexp which does not support a lot of things. Check it out here: Syntax · google/re2 Wiki · GitHub.
I had the same issue, tested on regex101, then the pattern did not work in Grafana, then learned that RE2 and PCRE2 are two different things.

1 Like

Would changing the selection to GoLang be the way to go here?

Hi,

Any solutions for this? We too stuck with the same issue. Able to get the result using the expressions in the site regex101 but the same is not working in Grafana.