diff --git a/tests/helpers/test_event.py b/tests/helpers/test_event.py index 9436226b335..b88f716a8ec 100644 --- a/tests/helpers/test_event.py +++ b/tests/helpers/test_event.py @@ -1903,7 +1903,7 @@ async def test_track_template_result_with_wildcard(hass: HomeAssistant) -> None: template_complex_str = r""" {% for state in states %} - {% if state.entity_id | regex_match('.*\.office_') %} + {% if state.entity_id | regex_match('.*\\.office_') %} {{ state.entity_id }}={{ state.state }} {% endif %} {% endfor %} diff --git a/tests/helpers/test_template.py b/tests/helpers/test_template.py index 851ba7fb79b..9994f0cadc1 100644 --- a/tests/helpers/test_template.py +++ b/tests/helpers/test_template.py @@ -3437,7 +3437,7 @@ async def test_async_render_to_info_with_wildcard_matching_entity_id( template_complex_str = r""" {% for state in states.cover %} - {% if state.entity_id | regex_match('.*\.office_') %} + {% if state.entity_id | regex_match('.*\\.office_') %} {{ state.entity_id }}={{ state.state }} {% endif %} {% endfor %}