Hi - I'm trying to use a regular expression to validate a data entry that has to be exactly 8 numeric digits. I tried
Regex _validGPID = new Regex(@"^\d{8}");
But that only catches entries that are less than 8 characters, not more. I also tried
Regex _validGPID = new Regex(@"^\d{8,8}");
But that didn't work either.
Can anyone help me out?
Loading
Bryian TanPosted Sep 14, 2010, 9:06 PM
Try something like this ^[\d]{8}$
Bryian TanPosted Sep 15, 2010, 10:08 AM
JeffPosted Sep 15, 2010, 9:39 AM