简体   繁体   中英

Dialogflow Agent regex entities definition

I have created an agent in dialogflow, for which I want to define an entity based on regex values, I know we have regex capability in defining the entities, but I don't know how to use it or how to define regex while defining the entity. There are no examples or blogs available to help me with this. I want to see an example or syntax of how to define regex entities so that I can replicate the same for my case. Any help will be highly appreciated.

Try this. Go to the Entity page. Create a new Entity an call it whatever you want. In the entity screen select regex and enter this value [A-Za-z]{3}[0-9]{7,10}$. Save the Entity. This regex will validate any value that begins with three letters and 7 to 10 character. Example PAP1234567 or DWL123456789.

Now go to an, intent or create one, and on the training phrases add one that says: My number is PAP12345678. Select the PAP12345678 to highlighted and the entities menu will appeared. Select the new regex entity and save.

Test the intent on DialogFlow. Hope this help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM