such as (?:(? [0+]d{2,3})? [s]? International Code
(?:(?:( 0{1,3}))? [0d] {1,4}) [s] Domestic area code
(?: [d]{7,8}| [d] {3,4} [S] [d] {3,4}) phone number (extension)
JScript Code
(^ (d{2,4}[-_--]?) d{3,8} ([-_--]?d{3,8})? ([-_--]?d{1,7})? $) | (^0?1[35]d{9}$)
Simple description
International area code + domestic area code + telephone Number:
^(?:(? [0+]d{2,3})? [s]? (?:(?:( 0{1,3}))? [0d] {1,4}) [S] (?: [d]{7,8}| [d] {3,4} [S] [d] {3,4}) $
(?:(? [0+]d{2,3})? [s]? International Code
(?:(?:( 0{1,3}))? [0d] {1,4}) [s] Domestic area code
(?: [d]{7,8}| [d] {3,4} [S] [d] {3,4}) phone number (extension)
function Istel (object)
{
var s =document.getelementbyid (object.id). value;
//Phone and mobile number authentication
var pattern =/^ ((d{11}) |^ ((d{7,8}) | ( D{4}|D{3})-(d{7,8}) | (D{4}|d{3})-(d{7,8})-(D{4}|d{3}|d{2}|d{1}) | (d{7,8})-(D{4}|d{3}|d{2}|d{1}) $)/;
//var pattern =/^ ([0+]d{2,3}-)? ( 0d{2,3})-(d{7,8}) (-(D{3,})? $/;
//var pattern =/(^[0-9]{3,4}-[0-9]{7,8}$) | (^[0-9]{7,8}$) | (^ ([0-9]{3,4}) [0-9]{3,8}$] | (^0{0,1}13[0-9]{9}$)/;
if (s!= "")
{
if (!pattern.exec (s))
{
Alert (' phone number entered incorrectly, please enter. ');
Object.value= "";
Object.focus ();
}
}
Else
{
Alert (' Phone number is not empty, please re-enter. ');
}
}