0

Please anyone can explain me , that what is the meaning of this regular expression

var str = '^([0|+[0-9]{1,5})?([7-9][0-9]{9})$';

This regular expression is used for check mobile number , But I am not able to find out how to check mobile number with that regular expression

Please Let me know

Thanks,

shivani
  • 870
  • 1
  • 6
  • 25
  • 1
    Easy way to figure out what a regex means is to just plug it into regex101 (though this one appears to have problems, `[0|+[0-9]` matches 0 to 9, or a pipe, or a plus) – CertainPerformance Jun 18 '19 at 06:20
  • I am not aware about regex101 , thanks for suggestion – shivani Jun 18 '19 at 06:22
  • 1
    [Regular Expression Visualizer](https://jex.im/regulex/#!flags=&re=%5E(%5B0%7C%2B%5B0-9%5D%7B1%2C5%7D)%3F(%5B7-9%5D%5B0-9%5D%7B9%7D)%24) – adiga Jun 18 '19 at 06:23
  • this ^(\+?\d{1,4}[\s-])?(?!0+\s+,?$)\d{10}\s*,?$ expression is used for check mobile number is valid or not – shivani Jun 18 '19 at 06:45
  • 1
    You can refer this doc and testing regular expression below link https://www.freeformatter.com/regex-tester.html – Alfaraz Shaikh Jun 18 '19 at 07:16

0 Answers0