Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Number in range regex

Hi i have a string which contains contact number. "xxxxxxxxx". I want to make a regex that checks for number ending in the range 70-79 in javascript. Can anyone please help with regex. I tried but not working.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Try this one. It will match any number ending with 70-79
enter image description here

^[0-9]+ it will match any number more than one time from the begining
7 is the exact number matching
[0-9]{1}$ means that the last number must be between 0-9 and it should match only once.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading