Hi, I wrote a regex to check a phone number format in my view-model but it always raises an error no matter how the number looks like.
I want it to be in either of these 2 formats
05XXXXXXXXX
02XXXXXXXXX
I want it to be in either of these 2 formats
05XXXXXXXXX
02XXXXXXXXX
C#:
[DataType(DataType.PhoneNumber)]
[RegularExpression(@"/^(0)[5|2]\d{9}\$/g", ErrorMessage = "Telefon numarayi 0xxxxxxxxxx formatinda girin")]
public string Telefon { get; set; }