Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

regex pattern for mobile number

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

mobile number regex javascript

/^[+]?[(]?[0-9]{3}[)]?[-s.]?[0-9]{3}[-s.]?[0-9]{4,6}$/im
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

phone regex

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

regex mobile

/(^(+88|0088|88)?(01){1}[3456789]{1}(d){8})$/
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery validation phone number 
Javascript :: neo4j create relationship between existing nodes 
Javascript :: js desktop notification 
Javascript :: javascript date get nearest 15 minutes 
Javascript :: javascript sort array strings alphabetically 
Javascript :: get data from url javascript 
Javascript :: node redis json set key 
Javascript :: replace double slash with single slash node.js 
Javascript :: draw image onto canvas js 
Javascript :: split every n character js 
Javascript :: electron main.js template 
Javascript :: copy file javascript 
Javascript :: nodejs wait function 
Javascript :: Sum of odd Fibonacci numbers JS 
Javascript :: concat array of objects javascript 
Javascript :: loop through javascript array 
Javascript :: jquery form validation plugin callback function 
Javascript :: bignumber to number javascript 
Javascript :: save text to file nodejs 
Javascript :: if input value is null do something 
Javascript :: react router refresh page 
Javascript :: update style with javascript react components 
Javascript :: replace data in files in node.js 
Javascript :: fetch api cors 
Javascript :: javascript negative infinity 
Javascript :: add char in specific index stirng javascript 
Javascript :: jquery on ready 
Javascript :: detect emoji in string javascript 
Javascript :: javascript iterate over object keys and values 
Javascript :: javascript get random number 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =