[thelist] regex help

Brian Cummiskey brian at hondaswap.com
Wed Feb 14 10:18:49 CST 2007


Hi All,

I'm stuck on a regex problem.  I need to validate some item numbers.
They are anywhere from 1 to 10 characters long, alpha, numeric, spaces, 
-'s and _'s only.

I'm already doing a len() and trim() on the var earlier, so i'm keeping 
the length requirements out of the reg ex for now while testing.  If you 
want to throw it in for good measure, be my guest :)

This is what i'm using, but it's failing on items with -'s and sapces:

regEx.Pattern = "[^a-zA-Z0-9 _ %\-]"

(note the space after 0-9)

do i need to set a boundary \b on it?   Not sure the best way on this.   
Appreciate your advice.

Thanks,
Brian






More information about the thelist mailing list