1

I'm using the following validation for fax numbers:

[RegularExpression(@"^\+[0-9]{1,3}\([0-9]{3}\)[0-9]{7}$", ErrorMessage = "This is not a valid fax number.")]

But the fax number form entry does not accept any input.

Simon Adcock
  • 3,554
  • 3
  • 25
  • 41

2 Answers2

2

Try this;

\+[0-9]{1,3}\([0-9]{3}\)[0-9]{7}

Sample outputs;

+895(194)6165163
+09(155)2541778

You don't need to use ^ for this. It means "except".

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
0
^[01]?[- .]?\(?[2-9]\d{2}\)?[- .]?\d{3}[- .]?\d{4}$

Try this........

Chetan Sanghani
  • 2,058
  • 2
  • 21
  • 36