mirror of https://github.com/grafana/grafana
InfluxDB: Fix regex for finding regexes in frontend code (#105194)
When interpolating variables in the frontend, we want to be sure to escape special characters if the variable is used in a regex. We used a regex to find regexes in raw queries, which contained a bug. The regex treated any `/` character as the start of a regex. However, InfluxQL (and most sql dialects) support using `/` as a division operator. This PR adds a check for `=~` or `!~` immediately preceding `/` as the beginning of a regex, as per the InfluxQL spec for regexes: https://docs.influxdata.com/influxdb/v2/reference/syntax/influxql/spec/#regular-expressions Fixes https://github.com/grafana/support-escalations/issues/16219pull/103937/head^2
parent
0e7e0b5f29
commit
8f4b2bbece
Loading…
Reference in new issue