Regex entity is meant for detecting patterns like email ID, phone number, etc., and collect relevant information from user messages.
To check if the regex is accepting the pattern, you can test the pattern using the Regex Pattern tab. If the value entered is according to the regex pattern, it will be highlighted, as shown below -
In the above example, if the user is not giving a valid PANCARD number, matching the regular expression pattern, then the IVA will send the Entity Reprompt message so the user can enter the right PANCARD number.
You can refer to https://regex101.com/ to learn more about regular expressions.
List of common regex patterns
|
Type of input |
Pattern |
|---|---|
| Multiline input from the users | [^\r\n]+((\r|\n|\r\n)[^\r\n]+)* |
| To accept any sentence from the user | .* OR \w* |