Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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
Comment

PREVIOUS NEXT
Code Example
Javascript :: react-native loading screen 
Javascript :: puppeteer clear input 
Javascript :: convert firestore timnestamp to javascript 
Javascript :: Hide elements until Alpine Js loads 
Javascript :: exceljs read file from input 
Javascript :: random string generator node js 
Javascript :: how to check data type of javascript variable 
Javascript :: select second child in js 
Javascript :: jquery each data 
Javascript :: js download json 
Javascript :: javascript custom events with data 
Javascript :: jquery scroll to element 
Javascript :: javascript assign value to input using name 
Javascript :: stop settimeout 
Javascript :: js replace non a-z 
Javascript :: document ready without jquery 
Javascript :: javascript timestamp in seconds 
Javascript :: router-link vue 
Javascript :: js num to string with leading 0 
Javascript :: htaccess for react 
Javascript :: how to detect a button click in javascript 
Javascript :: how to convert timestamp to date in react native 
Javascript :: select option in reactive forms 
Javascript :: c# get value from json object 
Javascript :: web3 check if contract 
Javascript :: trigger on change 
Javascript :: remove duplicate value from map react js 
Javascript :: how to find the width of outerconatiner in react native 
Javascript :: monitor changes made to object 
Javascript :: flutter keep local storage even after is closed 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =