Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

regex pattern for mobile number

/^(+d{1,3}[- ]?)?d{10}$/
Comment

regular expression for indian mobile number

Use the following regex

^(+91[-s]?)?[0]?(91)?[789]d{9}$
This will support the following formats:

8880344456
+918880344456
+91 8880344456
+91-8880344456
08880344456
918880344456
Comment

regex for mobile number

^+*[0-9]+$
Comment

phone number regex

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

regex for mobile number

^[6-9]d{9}$
Comment

regex phone number

# Examples of vaild phone numbers it accepts
9054286644
905-428-6644
(905)-428-6644
1-(905)-428-6644
(905)4286644
905 428 6644
12 903 455 6789

# Regex expression
^d{0,3}[- ]?[ ]*[(]?d{3}[)]?[- ]?[ ]*d{3}[- ]?[ ]*d{4}$
Comment

phone number regex

^[+0]{0,2}(91)?[0-9]{10}$
Comment

Regular Expression for Detect Iranian Mobile Phone Numbers | IR mobile number Regex Pattern

--For Use In Pattern HTML Tag
$rexexPattern="(+98|0|98|0098)?([ ]|-|[()]){0,2}9[0-9]([ ]|-|[()]){0,2}(?:[0-9]([ ]|-|[()]){0,2}){8}";
--For Use In JavaScript
var
mobileReg = /(+98|0|98|0098)?([ ]|-|[()]){0,2}9[0-9]([ ]|-|[()]){0,2}(?:[0-9]([ ]|-|[()]){0,2}){8}/ig,
junkReg = /[^d]/ig,
persinNum = [/۰/gi,/۱/gi,/۲/gi,/۳/gi,/۴/gi,/۵/gi,/۶/gi,/۷/gi,/۸/gi,/۹/gi],
num2en = function (str){
  for(var i=0;i<10;i++){
    str=str.replace(persinNum[i],i);
  }
  return str;
},
getMobiles = function(str){
  var mobiles = num2en(str+'').match(mobileReg) || [];
  mobiles.forEach(function(value,index,arr){
    arr[index]=value.replace(junkReg,'');
    arr[index][0]==='0' || (arr[index]='0'+arr[index]);
  });
  return mobiles;
};

// test
console.log(getMobiles("jafang 0 91 2 (123) 45-67 jafang or +۹۸ (۹۱۵) ۸۰ ۸۰ ۸۸۸"));

/*
support all option like these
912 123 4567
912 1234 567
912-123-4567
912 (123) 4567
9 1 2 1 2 3 4 5 6 7
9 -1 (2 12))3 45-6 7
and all with +98 or 0
+989121234567
09121234567
9121234567
or even persian numbers +۹۸ (۹۱۵) ۸۰ ۸۰ ۸۸۸

and only detect true iranian operator numbers 091x 092x 093x 094x

*/
Comment

regex for iranian phone number

'^(+98|0|0098)?9d{9}$'
Comment

regex expression for international phone number

Regex Expression: [0-9]{14}
Comment

PREVIOUS NEXT
Code Example
Javascript :: adding to array using reach hooks 
Javascript :: nuxt axios middleware 
Javascript :: jshint esversion: 6 
Javascript :: angular get current route 
Javascript :: app.use 
Javascript :: how to find largest number in array in javascript 
Javascript :: return symmetric difference of the array javascript 
Javascript :: js add html element to div 
Javascript :: stop interval js 
Javascript :: Too long with no output (exceeded 10m0s): context deadline exceeded 
Javascript :: find capital word in string javascript 
Javascript :: javascript open page 
Javascript :: formula for scrollbar size 
Javascript :: javascript get current day of month 
Javascript :: get params from route vuejs 
Javascript :: for object 
Javascript :: regex valid url 
Javascript :: react native navigation header right 
Javascript :: all input value empty jquery 
Javascript :: json data sample 
Javascript :: sum all the values in an array javascript 
Javascript :: http to https redirect express js 
Javascript :: function range() as range js 
Javascript :: reactnode prop-types 
Javascript :: jquery focus input end of text 
Javascript :: fix footer 
Javascript :: urlencoded limit nodejs 
Javascript :: js string to json 
Javascript :: document.getElementById(...).getContext is not a function 
Javascript :: javascript for each loop 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =