Search for string in condition

Hi! I’ve a JSON string and I want to search for specific words in a condition.
So instead of creating new condition for every word I stored all the words in a text helper.
And then as a condition use
{{trigger.payload_json["msg_text"] in regex_search(input_text.acars_alert_strings) }}

But it dont work… What have I done wrong?

{{trigger.payload_json["msg_text"] in regex_search( states('input_text.acars_alert_strings') ) }}

Tested and its not working…

Could it be my text helper? It contains just words like this:
COP POLICE CHOP TURBULENCE TURB FAULT DIVERT MASK AGENT MEDICAL SECURITY MAYDAY EMERGENCY RED WOMIT VATTEN PAX CABIN LIGHT FLASH BANG CLOGGED STORM LOUD WAITING TRANSIT MOTOR LOOSE TANK ERROR STRANGE STATE ADVICE PLS BIRD ALIEN BROKE

Found it…
This works…
{{trigger.payload_json["msg_text"] in states('input_text.acars_alert_strings')}}

Damn… it does not…

What about

{{ trigger.payload_json["msg_text"] is search(find=states('input_text.acars_alert_strings'), ignorecase=true) }}

Thanks… but is seams that there is an error…
image

Maybe not… image
Ive got false when I test it…
Could work… Hum… progress… :slight_smile:

Nope… If the helper contains 1 word it works, but not if there are several… thats odd…