Search code examples
c#regexwinforms

Regex for Number "05XXXXXXXX"


Hi I need to check the input string using Regex for Number as "05XXXXXXXX" which must be start with '05' only and must be 10 digits.

I tried this;

^(?:[1-9]|0[1-9]|5[0-9]|0[0-9]|10)$

Thanks


Solution

  • I think you want this:

    ^05[0-9]{8}$