Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js regex validate phone number

My regex of choice is:

/^[+]?[(]?[0-9]{3}[)]?[-s.]?[0-9]{3}[-s.]?[0-9]{4,6}$/im
Valid formats:

(123) 456-7890
(123)456-7890
123-456-7890
123.456.7890
1234567890
+31636363634
075-63546725
Comment

phone number validation regex javascript

// regex to match phone numbers entered with delimiters (spaces, dots, brackets, etc.)

/^+?d{1,4}?[-.s]?(?d{1,3}?)?[-.s]?d{1,4}[-.s]?d{1,4}[-.s]?d{1,9}$/
Comment

regex to check the phone number javascript

//To check that the phone number is of 10 digits
let regex=/^[0-9]{10}$/;
Comment

javascript regex check phone number

let pattern = /^[62|0]+d{10}/gi
let phone = '087887242822'
console.log(pattern.test(phone))
Comment

how to validate phone number regex javascript

/^d{3}(-|s)d{3}(-|s)d{4}$|^d{10}$|^1sd{3}(-|s)d{3}(-|s)d{4}$|^(1s?)?(d{3})(s|-)?d{3}-d{4}$/
Comment

PREVIOUS NEXT
Code Example
Javascript :: shorthand for document.ready 
Javascript :: node gitignore 
Javascript :: document .ready 
Javascript :: how to get name array value in jquery 
Javascript :: how to get the year in javascript 
Javascript :: include partials ejs 
Javascript :: javascript sort boolean value 
Javascript :: math.random javascript 
Javascript :: chart js hide legend 
Javascript :: pass csrf token in ajax laravel 
Javascript :: regular expression for links 
Javascript :: get header height jquery 
Javascript :: get browser language 
Javascript :: convert text filed to password field in jquery 
Javascript :: angular pipe capitalize 
Javascript :: fs check if dir is dir 
Javascript :: npm remove dev dependencies from node_modules 
Javascript :: jquery checkbox checked value 
Javascript :: remove curly brackets from stringify javascript 
Javascript :: add background image to div using jquery 
Javascript :: submit form through jquery by id 
Javascript :: Javascript how to run hello world 
Javascript :: check window resize javascript 
Javascript :: js format price 
Javascript :: node read file line 
Javascript :: JS get length of an object 
Javascript :: angular ng serve with custom port 
Javascript :: js search json 
Javascript :: console.log object object 
Javascript :: change firebase region 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =