Auth0 Home Blog Docs

Passwordless SMS refuses phone number (regex fail)


Why am I getting this message, both in the Auth0 Dashboard where you set up and test Passwordless SMS, as well as the /passwordless/start API call?

Phone number (example): 15551235555

error: bad.phone_number
description:“String does not match pattern: ^\+[0-9]{1,15}$

um, excuse me? Yes this number most certainly does match the dang pattern. What am I missing here???


Hi @dapug! Maybe you are missing the ‘+’ sign in front of the number? Let me know if it works with it! Thanks!



Correct, I was missing the +. It was not immediately obvious for a dev unfamiliar with regex (not my cup of tea) and new to Auth0. Even a regex tester tool doesn’t understand that expression.

The error message is NOT helpful or appropriate and should be changed. This is the first time I’ve ever seen a regex definition in a friggen error message in 20 years of coding. Try using English, such as “The phone number was not valid. Please make sure the number is correct, including country code, and “+” prefix”.

Helpful feedback for your team. :slight_smile:



Thanks for your valuable feedback! I agree this is not a good validation message, will raise the concern to the appropriate team :slight_smile:

1 Like

Hey @dapug!

Your feedback was submitted to one of our product teams. Thanks a lot for that! We gather developer community feedback and then appropriate team implements it based on priorities they set for the specific team backlog.

For future reference, if you’d like to share some product feedback with us and get it immediately added to to our product backlog, the easiest way to do it directly is through our feedback site:

Thanks a lot!

1 Like
closed #7

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.