We so very badly need regex support in the jinja2 filters. Ansible has a similar jinja2 filter called regex_search
I believe. This would save a lot of headaches when trying to parse strings. Currently we have to resort to weird solutions like:
{%set thing = states['input_boolean']['door_keypad_10_4th_bedroom_switch'].object_id%}
{% set ident = "_".join(thing.split("_")[3:-1]) %}
ident:{{ident}}
just to get at the substring 4th_bedroom!
Don’t forget to upvote this if you too want the feature!
Please please please…