so i have this reg ex
0*[0-9]\d*
which accepts numbers only how would i, make it to accepts numbers only but have a minimum input of 5 numbers?
I this will do what you're wanting.
^\d{5,}$
Here's a template for you:
<expression>{length}
<expression>{min,}
<expression>{min,max}
In your case it will be:
\d{5,}
See the sandbox.
To specify the minimum ammount of symbols use {n,}
where n
is 5 in your example, so regex would be \d{5,}
String pattern = @"\d{5,}";
var result = Regex.Match("12345", pattern);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With