I need to make an expression that will check the incoming text for at least one of the words, case insensitive.
Right now, for each word I add two validation expressions.
In the future, a list of these words will be taken for each call from mysql.
Can you tell me if n8n can do such checks with expressions?
n8n supports regular expressions in the IF node. So you could use a regular expression such as /word1|word2|word3/i to perform your check. Here’s a quick example workflow:
The n8n expression I am using inside my regular expression is $("Mock word list").first().json.words.join("|"). This reads the first item from my “Mock word list” list node and then joins all words in my “words” field using a pip character |. It will of course also work with more than 3 words.
Hope this helps! Let me know if you have any further questions on this