regex that matches exactly 10-digit numbers

Asked 5 months ago Modified today Viewed 190 times Asked By Sai Kishore
0

We need to extract 10-digit numbers from a given string. We're currently using "[0-9]+" with OScript's pattern matching, but this doesn't allow us to specify the exact digit count. We've been trying to find the correct regular expression, but haven't had success so far.

Could you please help us with a regex that matches exactly 10-digit numbers?


Answers

0

/^\d{10}\s?[a-zA-Z0-9]+$/gm

or 

\b\d{10}\b
Answered by Fayaz S T 5 months ago

Your Answer