IBM Watson - Sys-number not getting 0
in this case I want to use sys-number
to get a sequence of numbers and that number can start at 0. But if the user types 034234342342
, the sys number is not recognized 0
, just 34234342342
.
Do you have a Contorn Solution for this? In this case, to get the whole number?
This is one condition Regex
within the conversation thread and I want to use sys-number
to get ALL the number if the user enters "My protocol number is 034234342342". And it sys-number
will be a new condition and will receive the full number.
If not, use sys-number
. Please try to answer me how to do it in this case.
EDIT:
Check out my example:
source to share
You can use @ sys-number to define this number. Otherwise, you can do:
input.text.find('\d{11}')
find()
allows you to find any occurrence, and matches()
- full line match.
The capture can be used:
<? input.text.extract('\d{11}',0) ?>
It also allows you to capture groups.
Otherwise, you won't be able to capture the previous zeros with @sys-number
.
Also, if you put checks directly into JSON, you need to exit \
with \\
.
source to share