Hi Kevin,
Welcome to the community, sorry for the delay in response.
I think using regex would work. In a Set Variable action (string variable, e.g. NormalizedCode): ReplaceRegex(ToString(Slot.VerificationInput), "[^0-9]", "") and then check if it is 6 digits to match the verification code. If it is more or less than 6, it could take the failure route of try again/resend.
Hope this helps, but let us know if you have any more questions
------------------------------
Sam Jillard
Online Community Manager/Moderator
Genesys - Employees
------------------------------
Original Message:
Sent: 12-18-2025 15:32
From: Kevin Waller
Subject: Removing non-digits from a string
Hello community, if this is in the wrong spot i apologize in advance as this is my first post. Is there a simple way to remove all non-digits from a string in a bot flow? i.e. Bot: I just sent you a 6 digit verification code, let me know the code when you get it. User: Uh yeah, its 1234 56. I just want 123456 set to the var so i can compare. I was thinking regex but if the person replies "not yet" or "i didn't get it" i would like to compensate for that to, small thought in the back of my head was not to treat any no match as i didn't get it. Any advice in any direction (including where else to post) is greatly appreciated.
#Community Questions (Contest, Community, etc.)
------------------------------
Kevin Waller
Senior Telecommunication Architect
------------------------------