I am trying with this query
MATCH(u:User) WHERE ANY(name IN ['ACB','xYz'] WHERE u.first_name =~ "(?i).*name.*") RETURN u
it is considering (?i).*name.*
as static text instead of dynamic value from name IN ['ACB','xYz']
.
You can assemble a regex expression using string concatenation. This case however needs some toString
hinting:
MATCH(u:User) WHERE ANY(name IN ['ACB','xYz']
WHERE u.first_name =~ toString("(?i).*" +name +".*"))
RETURN u