I know it is possible when writing queries to place a condition between two literals, like so:
SELECT * from cells_coverage where ‘Any’ = ‘Any’ limit 1
It is useful to me when using Grafana to write complex queries that depend on dashboard variables.
SELECT * from cells_coverage where ‘Any’ = ‘$someVariable’ limit 1
I then tried to write a condition between a literal and a regex, like so:
SELECT * from cells_coverage where ‘Any’ =~ /^Any$/ limit 1
… result …
Again, it makes sense once the inside value of the regex is replaced with a variable.
I’m running into a problem though when I try to use multiple values variable in Grafana.
What happens is that the regex will change from /^Any$/ to /^(Any)$/ and thus when querying InfluxDb I get the following:
SELECT * from cells_coverage where ‘Any’ =~ /^(Any)$/ limit 1
ERR: invalid expression: ‘Any’ =~ /^(Any)$/
I’m not sure why would that be an invalid expression. Why would the regex be valid without the parenthesis, but invalid with them?