You can test expressions when you create regular expression slot types in Genesys Dialog Engine Bot Flows and Genesys Digital Bot Flows before or after you publish the flow.

When you create slot types, the Test Utterance field enables you to create a sample utterance, test the utterance, and then find new or existing regular expressions that highlight any matches to the utterance text. This process alleviates the need to use third-party tools to create and test expressions and can also provide insight about how best to use these expressions in your bot flows.

Click the image to enlarge.

Test Utterance view

  • In the Test Utterance box, add a defined sample utterance for defined regular expression testing.
  • In the Regular Expression row, add a defined regular expression to search patterns and identify matches to the test utterance. 

Notes:
  • The bot evaluates regular expression matches from top to bottom. For example, if the third, fourth, and sixth rows in your regular expression list match the sample utterance, the bot only highlights and uses the third row.
  • If more than one element of a test utterance is a potential match for an expression, the last matched element takes priority. For example, if the test string contains three matches, the bot chooses the match nearest to the end of the string.
  • If you save your regular expression, then the last matching test utterance and the regular expression both appear in a yellow highlight. 
  • If you do not save your regular expression or you leave it in edit mode, then a matching test utterance appears in a blue highlight. 

Test a sample utterance against a regular expression

To test a sample utterance against a regular expression, follow these steps:

  1. Open an existing bot flow or digital bot flow, or create a new one.
  2. Under Natural Language Understanding, click Slots.
  3. Click Add Slot.
  4. Provide a meaningful name for the slot. For example, ZipCodeLocations.
  5. Under Associated Slot Type, click New RegEx.
  6. Type a meaningful name for the custom RegEx slot type; for example, Zip Code. If you do not type a name, Architect adds one for you.
  7. Click Save.
  8. Click the new RegEx slot type.
  9. Add one or more regular expression slot type values. For example, \b[0-9]{5}\b.
  10. In the Test Utterance box, type an example string that you want to match to a regular expression. For example, “What is the closest recording studio to 46167?”
    Note: If the bot flow finds a match, it highlights the utterance match and the saved regular expression in yellow, or it highlights the utterance match to an unsaved regular expression in blue.