My words (phone numbers) may have in the beginning “00” or “+”.
Example number phone:
00xxx xx xxxxxxx
+xxx xx xxxxxxx
(+xxx) xx xxxxxxx
(00xxx) xx xxxxxxx
I have:
Regex regexObj = new Regex(@"^\(?[+( ]?([0-9]{3})\)?[) ]?([0-9]{2})[- ]?([0-9]{7})$");
if (regexObj.IsMatch(TextBox1.Text))
{
// IF OK
string formattedPhoneNumber = regexObj.Replace(TextBox1.Text, "(+$1) $2 $3");
}
How to put it in the regular expression? For now I can only put the “+”, and “(” , “)”
thanks
how about this:
EDIT: