Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

phone number formatter javascript grepper

// Checks if a string is a valid americain phone number with regex

var phoneFormatterRegex = function (phoneNumber) {
  return /^d{3}-d{4}$/.test(phoneNumber);
}
 
PREVIOUS NEXT
Tagged: #phone #number #formatter #javascript #grepper
ADD COMMENT
Topic
Name
3+4 =