IBM Watson - Sys-number does not get 0
Asked Answered
O

1

1

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

Overflow answered 18/4, 2017 at 12:28 Comment(0)
A
1

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 \\.

Anyone answered 18/4, 2017 at 17:22 Comment(3)
Yes but if user dont types the number, the conversation will flow. Currently, have some condition (you did this condition) for get 11 numbers with extract, and ONLY if user type 11 numbers (and only the numbers) the conversation will flow. I want some solution for if user type "My number is 11122233344". the conversation will flow and the number will be extractOverflow
with input.text.find('\\d{12}') condition this will get the number if start with 0? and conversation will flow?Overflow
It should match exactly 12 digits. If you want a range then {5,10} for example.Cinderella

© 2022 - 2024 — McMap. All rights reserved.