validador de telefone javascript
function validPhone (phone) {
var regex = new RegExp('^\\([0-9]{2}\\)((3[0-9]{3}-[0-9]{4})|(9[0-9]{3}-[0-9]{5}))$');
return regex.test(phone);
}
validPhone('(31)3534-2323'); //Valido
validPhone('(31)9923-23288'); //Valido
validPhone('(31)9923-3288'); //Invalido
validPhone('(31)2323-5443'); //Invalido
Also in JavaScript:
- how to create multiple folders at once in node js
- value from getelementbyid
- adonis column alter
- how to get focused element in jquery
- discord.js bad word filter
- nodejs express routing get
- pyspark from_json example
- loopback model find by id
- infinite scrolling firestore vuejs
- jquery close bootstrap model
- accèder data-id javascript
- how to add array numbers in javascript
- express nodejs
- drupal 8 node has field
- add variable numerically in javascript
- how to make a css clock
- How to replace an array vue.js
- jquery find div with data attribute value
- angularjs 1.5.6 cdn
- flutter
- check if a variable is undefined jquery
- javascript class click event
- javascript if statement
- how to read environment variable in node js