Hello Subhajit,
The behavior you're seeing is due to how the bot flow processes input versus how the NLU testing works. The bot is actually performing a "sanitization" of the input before storing it, which is why you see the special characters removed in the Set Participant Data action. However, this happens after the validation step. This is why you are seeing the special characters.
I can think you can get around this if you "Ask for Slot" action, add an additional validation step. Configure the "Validation" section of the Ask for Slot action. Set up a custom validation expression that matches your regrex pattern. Then configure the error message to be shown when the validation fails.
To be specific to your issue:
Enable input validation > Set the validation pattern to match your regex: ^[a-zA-Z0-9]{1,17}$ > configure your "No Match" message > set "Retry on Failure" to Yes.
Make sure the flow branches based on the validation result:
Success: Continue to your next step
Failure: Return to asking for input.
Hope this helps!
------------------------------
Cameron
Online Community Manager/Moderator
------------------------------