In my Jinja template, model.DataType
value can be user defined or built in. My requirenement is if model.DataType
start with the three letters ARR
, then do a specific operation.
Example of values:
- ARRstruct124
- ARR_int123
- ARR123123
- CCHAR
- UUINT
- etc.
{% set evenDataType = model.eventDataType %}
{%if evenDataType | regex_match('^ARR', ignorecase=False) %}
// do the operation
{%else%}
// do the operation
{% endif %}
With this template, I am getting the error
{%if evenDataType | regex_match('^ARR', ignorecase=False) %}
jinja2.exceptions.TemplateAssertionError: no filter named 'regex_match'