Clément Beaujoin
Clément Beaujoin

Reputation: 48

Intent detects regex entity

Since regexp entities are available, I added one to my agent. This entity is used as a required parameter of my intent. After some tests it seems to not detect my intent using a word matching the regexp. Any idea ?

IE :

Intent Training phrase: "my car is registered aa123aa"

"aa123aa" is the resolved value of a parameter of type regNum entity.

Entity regNum : ^[a-hj-np-tv-z]{2}(?:\s|-)?[0-9]{3}(?:\s|-)?[a-hj-np-tv-z]{2}$

I expect that the following phrase should match the intent and resolve the parameter value : "my car is registered bb123bb"

In fact it matchs the intent but it's unable to resolve the parameter value.

Moreover if I use the training phrase "my car is registered aa123aa" it does not resolves the parameter value either

Upvotes: 0

Views: 981

Answers (1)

Marc
Marc

Reputation: 59

Dialogflow uses re2 regex. for more information visit this repository

For example:

ABc1234@ is equivalent to \A([A-Z]{2}[a-z]{1}[0-9]{4}[!@#$%^&*(),.?":{}|<>]{1})\z

\A - beginning of text
[A-Z]{2} - two uppercase letter A-Z
[a-z]{1} - one lowercase letter a-z
[0-9]{4} - four numbers
[!@#$%^&*(),.?":{}|<>]{1} - one special character.
\z - end of text

Upvotes: 1

Related Questions