I have this function which works only for 10 digits.
function telValide( tel )
{
var reg = new RegExp(\'^[0-9]{10}$\', \'i\');
return reg.test(tel);
}
<
I guess it's a simple case:
^0[67][0-9]{8}$
Try it /^\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})$/
and for more details check below links help you how validate your phone and defined specific format
http://www.zparacha.com/phone_number_regex/
http://dzone.com/snippets/regular-expression-validate
var reg = new RegExp('^((06)|(07))[0-9]{8}$', 'i');
'^0(6|7) [0-9]{8}$'
Or if you mean you want the numbers without a space:
'^0(6|7)[0-9]{8}$'
Check out some excellent regex tutorials here and here.
The easiest pattern would probably be
^0[67]\d{8}$
i.e.
That assumes that your white space is merely for emphasis.
You could also be fancy and use a lookahead
^(?=0[67])\d{10}+$
This isn't really adding much expect complexity however.