Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

indian phone pattern regex

pattern:
^(?:(?:+|0{0,2})91(s*[ -]s*)?|[0]?)?[456789]d{9}|(d[ -]?){10}d$


//Valid Scenarios:
4567589390
5678896759
6788509595
+91-9883443344
9883443344
09883443344
919883443344
0919883443344
+919883443344
+91-9883443344
0091-9883443344
+91 -9883443344
+91- 9883443344
+91 - 9883443344
0091 - 9883443344
7856128945
9998564723
022-24130000
080 25478965
0416-2565478
08172-268032
04512-895612
02162-240000
+91 9883443344
022-24141414


//Invalid Scenarios:
WAQU9876567892
ABCD9876541212
0226-895623124
6589451235
0924645236
0222-895612
098-8956124
022-2413184
Comment

regex pattern for mobile number

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

valid phone number regex with country code

((00)?(+)?d{1,3})[-s]+(d{1,3})[-s]+(d{4,10})
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

Extract phone number from text regex

(?[2-9][0-9]{2})?[-. ]?[2-9][0-9]{2}[-. ]?[0-9]{4}
Comment

validate phone number regex

// Commonly used regular expression

// Check 2-9 characters, false if not matched, true if matched
const validateName = (name) => {
   const reg = /^[u4e00-u9fa5]{2,9}$/;
   return reg.test(name);
};
// Verify phone number
const validatePhoneNum = (mobile) => {
   const reg = /^1[3,4,5,6,7,8,9]d{9}$/;
   return reg.test(mobile);
};
// Check passwords consisting of 6 to 18 uppercase and lowercase alphanumeric underscores
const validatePassword = (password) => {
   const reg = /^[a-zA-Z0-9_]{6,18}$/;
   return reg.test(password);
};
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

regex for valid phone number

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

general phone number regex

^(?:(?:+?1s*(?:[.-]s*)?)?(?:(s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])s*)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))s*(?:[.-]s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})s*(?:[.-]s*)?([0-9]{4})(?:s*(?:#|x.?|ext.?|extension)s*(d+))?$
Comment

phone regex

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

regex expression for international phone number

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

regex for international phone number

+(9[976]d|8[987530]d|6[987]d|5[90]d|42d|3[875]d|
2[98654321]d|9[8543210]|8[6421]|6[6543210]|5[87654321]|
4[987654310]|3[9643210]|2[70]|7|1)
W*dW*dW*dW*dW*dW*dW*dW*dW*(d{1,2})$
allows for valid international prefixes 
Comment

PREVIOUS NEXT
Code Example
Javascript :: ternary operator in angular 
Javascript :: convert date to readable format javascript 
Javascript :: assign class to element javascript 
Javascript :: export apk react native 
Javascript :: express request body undefined 
Javascript :: Removing Service Workers Programmatically 
Javascript :: extract value from array of objects javascript 
Javascript :: sublime format json 
Javascript :: useref 
Javascript :: regexp object javascript 
Javascript :: render react in blaze 
Javascript :: javascript set to array 
Javascript :: remove comma from number javascript 
Javascript :: javascript string interpolation 
Javascript :: upload multiple files axios 
Javascript :: javascript includes 
Javascript :: javascript reduce fraction 
Javascript :: how to delete element in list javascript 
Javascript :: npm shrinkwrap primordials 
Javascript :: time taken for a function javascript 
Javascript :: how to hide a input and label jquery 
Javascript :: ERESOLVE unable to resolve dependency tree 
Javascript :: hex string to buffer nodejs 
Javascript :: how to get url params value in node js 
Javascript :: JSON Web Token (JWT) set expire time in node js 
Javascript :: datatable order number 
Javascript :: reactjs cdn 
Javascript :: nodejs mysql getting the id of an inserted row 
Javascript :: js get form inputs 
Javascript :: ignore eslint warning one line 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =