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

phone number validation regex

// 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 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

phone number validation regex

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

Matches the following

123-456-7890
(123) 456-7890
123 456 7890
123.456.7890
+91 (123) 456-7890
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 :: angular viewchild input element value 
Javascript :: onMounted 
Javascript :: get iso date javascript 
Javascript :: remove object from array of objects based on object property javascript 
Javascript :: codeigniter raw query 
Javascript :: js delete duplicates from array 
Javascript :: get only numbers regex javascript 
Javascript :: performance.now nodejs example 
Javascript :: Code to Unsubscribe all youtube channels. 
Javascript :: chartjs start at 0 
Javascript :: discord javascript error cannot find module 
Javascript :: javascript sort array of objects ascending and descending order 
Javascript :: apply back button to a react component 
Javascript :: Copy document DOM without reference 
Javascript :: trheejs cube mesh 
Javascript :: react router get host js 
Javascript :: react native display flex center 
Javascript :: delayed in js 
Javascript :: javascript add div before element 
Javascript :: how to get iso date with moment 
Javascript :: react native detect production 
Javascript :: favicon in next js not working 
Javascript :: checkbox click event jquery 
Javascript :: vue js footer copyright date automatically 
Javascript :: how to ask input in javascript 
Javascript :: afficher un div qui etait cache en javascript 
Javascript :: check if string is valid json dart 
Javascript :: window.open javascript auto close 
Javascript :: Codewars Calculate average 
Javascript :: websocket sample code js 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =