Answer validation of a question with Regex

(Kurt) #1

I’m using the answer validation of a question with Regex. I am using the following expression: /.\w.+/g

With this expression as validation I was expecting just to accept inputs like the word ‘’ .car. ‘’

But, when I type something that does not match the regex, the flow stops.

What to do?

(Kurt) #2

Another question: How to include an emoticon in a regex? Should I try to get the emoticon Shortcode?

(Daniel Beckett) #3

If you’re using validation on a question it will always expect an answer from the user that meets the validation criteria or for them to skip the question (if skip is enabled). That’s the only way for the flow to progress.

In regards to using emoticons I don’t believe that’s possible with regex validation.

(Kurt) #4

Yes, I understood. But when I send a different message, this did not trigger the sending of the Custom Validation Message by the bot. what should I do to verify that the regex is working?

Thanks

(Daniel Beckett) #5

Sites like regexr.com can be used to test your regex. You should also check your interaction log for the flow to see if there are any errors.

(Kurt) #6

I tried just that site, the regex expression seemed right. And my log interaction is as follows.

(Daniel Beckett) #7

When I tested your expression it was returning matches for all text.

I think that if you’re looking for matches for things like:
test.car
example.car

Then the following regex could work better:
/(.+)\.(.+)/g