Jinja2
Check a pattern on a string
Check by a pattern on the beginning of a string
{% if my_string.startswith('pattern') %}{% endif %}
{% if my_string[:len('pattern')] == 'pattern' %}{% endif %}
Check by a pattern on the end of a string
{% if my_string.endswith('pattern') %}{% endif %}
{% if my_string[-len('pattern'):] == 'pattern' %}{% endif %}
Check by a pattern into a string
{% if 'pattern' in my_string %}{% endif %}