{% set my_string = 's3://example/path' %}
{% set s3_path_pattern = 's3://[a-z0-9-_/]+' %}
{% set re = modules.re %}
{% set is_match = re.match(s3_path_pattern, my_string, re.IGNORECASE) %}
{% if not is_match %}
{%- do exceptions.raise_compiler_error(
my_string ~ ' is not a valid s3 path'
) -%}
{% endif %}
For your case it would be something like
{% set pattern= 'sem retorno' %}
{% set re = modules.re %}
{% set is_match = re.match(pattern, result_lista_fornecedor, re.IGNORECASE) %}
{{ return( is_match ) }}
{% endif %}