Phone number validation with Parentheses sign - Javascript RegExp

Javascript examples for RegExp:Match Phone Number

Description

Phone number validation with Parentheses sign

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=( function() {//from  w  w w  .ja  va 2 s  .c om
console.log( !! "(123)4567890".match(/\(\d{3}\)\d{7}/g));
console.log( !! "123)4567890".match(/\(\d{3}\)\d{7}/g));
console.log( !! "1234567890".match(/\(\d{3}\)\d{7}/g));
    });

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials