Regex for blocking specific words not working in plain text filter

:us: I am trying to set up a filter to block specific words in the “Model” field. The goal is to prevent the field from containing any word from the list below:

Words to Block: 208, Astra, Bora, Bravo, C3, Cerato, Fox, Gol, HB20, Idea, Ka, Mile, Mille, Mondeo, Omega, Onix, Palio, Picasso, Punto, Pulse, Sentra, Spin, Tipo, Vectra, Versa, Yaris

Expression Used:
^(?!.*\b(208|Astra|Bora|Bravo|C3|Cerato|Fox|Gol|HB20|Idea|Ka|Mile|Mille|Mondeo|Omega|Onix|Palio|Picasso|Punto|Pulse|Sentra|Spin|Tipo|Vectra|Versa|Yaris)\b)

Expected Behavior: Blocked strings: “Astra,” “Gol,” “HB20,” etc. Allowed strings: “Civic,” “Corolla,” “Fusion,” etc.

Issue Encountered: The filter is not blocking words from the list. Even if the value contains, for example, “Astra” or “Gol,” it passes validation without any problems.

Environment: Field: Plain text Operator: “Does not match pattern”

Questions: Is there any limitation of the tool regarding negative lookaheads ^(?!..)? How can I rewrite this condition to make the filter work correctly with plain text? Is there another approach without using Regex that could solve this problem?

Thank you for any help or suggestions!


Estou tentando configurar um filtro para bloquear palavras específicas no campo “Modelo”. A intenção é impedir que o campo contenha qualquer palavra da lista abaixo:

Palavras para Bloquear:
208, Astra, Bora, Bravo, C3, Cerato, Fox, Gol, HB20, Idea, Ka, Mile, Mille, Mondeo, Omega, Onix, Palio, Picasso, Punto, Pulse, Sentra, Spin, Tipo, Vectra, Versa, Yaris

Expressão Utilizada:
^(?!.\b(208|Astra|Bora|Bravo|C3|Cerato|Fox|Gol|HB20|Idea|Ka|Mile|Mille|Mondeo|Omega|Onix|Palio|Picasso|Punto|Pulse|Sentra|Spin|Tipo|Vectra|Versa|Yaris)\b).

Comportamento Esperado:

  • Strings bloqueadas: “Astra”, “Gol”, “HB20”, etc.
  • Strings permitidas: “Civic”, “Corolla”, “Fusion”, etc.

Problema Encontrado:
O filtro não está bloqueando palavras da lista. Mesmo que o valor contenha, por exemplo, “Astra” ou “Gol”, ele passa pela validação sem problemas.

Ambiente:

  • Campo: Texto simples
  • Operador: “Does not match pattern” (não corresponde ao padrão)

Perguntas:

  1. Existe alguma limitação da ferramenta para lookaheads negativos ^(?!...)?
  2. Como posso reescrever essa condição para o filtro funcionar corretamente em texto simples?
  3. Existe outra abordagem sem usar Regex que resolveria essa situação?

Agradeço qualquer ajuda ou sugestão!

Welcome to the Make community!

You used a negative lookahead incorrectly.

Your pattern should just be

\b(208|Astra|Bora|Bravo|C3|Cerato|Fox|Gol|HB20|Idea|Ka|Mile|Mille|Mondeo|Omega|Onix|Palio|Picasso|Punto|Pulse|Sentra|Spin|Tipo|Vectra|Versa|Yaris)\b

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.