Search code examples
ibm-watsonwatson-conversation

IBM Watson - Sys-number does not get 0


in this case, I want to use sys-number to get numbers sequence, and this number can start with 0. But, if the user types 034234342342, the sys-number does not recognize the 0, just 34234342342.

Have any Contorn Solution for this? In this case, to get all number?

This is one Regex condition inside Conversation flow and I want to use sys-number to get the ALL number if the user types "My protocol number is 034234342342". And sys-number will be the new condition and get the complete number.

If not have how to do it with sys-number. Please, try answer to me how to do that in this user case.

EDIT:

Check my example:

enter image description here

My try it out: enter image description here


Solution

  • You should be able to use @sys-number to detect that number. Failing that you could do:

    input.text.find('\d{11}')
    

    find() allows to find any occurrence, while matches() is a full line match.

    Capturing you can use:

    <? input.text.extract('\d{11}',0) ?> 
    

    That also allows group capturing.

    Other then this you won't be able to capture preceding zeros with @sys-number.

    Also if you put the checks directly into the JSON, then you need to escape out the \ with \\.