I try to select a string based on regex, I use node.js ,here is my code :
var string = ' [email protected] Tel: +971000000000 0500000348';
var regExp = '\\(\\+971\\|00971\\|05\\)\\d\\{1,12\\}';
var find = string.match(regExp)[0];
console.log(find);
I need to select only numbers that starts with +971 , 00971, 05 , this returns null, (I had to escape twice coz it throws an error if I don't)
this regex works fine: '\\+971\\d{1,12}';
