Articles on: Crisp Chatbot

What are pattern matches and how do they work?

Using the autoresponder or the chatbot, you'll get familiar with pattern matches. It will make your bot smarter and help the robot to send contextualized answer, based on customer messages


What is a pattern match?



A pattern is a regularity in the world. The elements of a pattern repeat in a predictable manner. At Crisp, we take advantage of patterns to build repetitive behaviors for our bots and autoresponders.

Here is an examples of a user message matches available in the chatbot that uses pattern matches to work:

Example of a pattern matching the word "Invoice"

Note that pattern are key sensitive, meaning that you have to take mistakes from your users into account.

How are message patterns formatted?



Message patterns are used to match sections of user messages. For instance, if I want to match an 'Hello, I have a question.' message, a pattern such as 'question' can be used.

You can use wildcards ('*') to fuzzy-match parts of user messages.

Some languages, such as Chinese, Thai and others have no spaces between words in sentences. In such case, the regular pattern wildcard '*' won't work to match "any word" between given words. You're looking to use a double wildcard instead ('**'), which is not space-aware.

Here are some examples of matching patterns:

Message 1: Hello, I need help. matches pattern *help*

Message 2: Hi! I have a question. matches pattern hi*question

Message 3: My MacBook is broken. Is there some warranty? matches pattern *macbook is broken.**warranty*

Here are some examples of non-matching patterns:

Message 1: Okay that sounds good. does not match pattern help*me

Message 2: Can I speak to Baptiste? does not match pattern can*speak*to*valerian

What is negative pattern match?



Negative pattern matches means that bot scenario will trigger only when it doesn't see this word in the chatbox. This is an option that can be activated on each "user message matches" block to trigger a specific behavior.

Example of a negative pattern match

Updated on: 28/10/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!