Filter value via regex

Hi

I have a variable called OF1 which has different values. I have two fields and I want to filter the value of one of the fields. Is it possible to filter it via regular expressions? This is what I have try.

|> filter(fn: (r) => r[“_field”] == “Valor” and r[“_value”] =~ /^${OF1}:regex}$/)

Thanks

Hello @JMU,
yes absolutely please see:

This is how I fix it:

|> map(fn: (r) => ({ r with _level: if r._field ==“Valor” and r._value == int(v: “${OF1:regex}”)

I convert de regex to int.