Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Using RegEx Entity with other entitiy in Traning Phrase gives empty value for the parameter

n Dialogflow ES I am using a Regular Expression for the date format (DD/MM/YYYY) validation. If I have the training phrase as 22/05/2021 it works perfectly.

But I need to have the training phrase as 22/05/2021 sample@sample.com. When I use like that, for the date it gives empty value.

empty_mydate.png

Not even for this mydate validation, this is not working if I use any RegEx entity along with other entity in the same training phrase.

Dewmini_0-1666237657284.png

myDigit RegEx is ^[0-9]$

So can't it be used Regex entity along with other entity in the same training phrase in Dialogflow?

Solved Solved
0 4 1,051
1 ACCEPTED SOLUTION

Sorry for the delay in replying, I see that your regular expression is matching the end of the line with “$” after the digit (^[0-9]$). This would explain why you are able to capture the data when the training phrase contains only the digit, but not when additional data is located after (for example, “2 sample@sample.com” does not contain the EOL metacharacter after “2”, but having only “2” as the training phrase does).

If your date regular expression matches the end of the line as well, you’d see the same behavior. I made a quick intent using this expression to match “DD/MM/YYYY”: ^[0-9]{2}\/[0-9]{2}\/[0-9]{4}. As shown below, it captures both the date and Email:

Screenshot 2022-10-26 11.46.11 AM.png

 

View solution in original post

4 REPLIES 4