Instead of using Regular Expression, I would suggest the following validation:
- Compare the length of the input string with 5 and 20, check up if it's in the valid range. (You may want to trim the string before doing it.)
- Check if this a valid number:
Dim input As String =
Dim value As ULong
If ULong.TryParse(input, value) Then
End If
Why? Because one of your validation steps will also give you the numeric value for free; it's very like that you will need it. :-)
—SA