11-20-2009 12:43 PM
Now that I'm cross-eyed, I need help with a regular expression.
These need to pass (or permutations thereof):
[00123]
[R012]
[r083]
These need to fail (or permutations thereof):
[test]
[I was here]
[098 876]
[29873 eifvuh]ouh]
I have most of it ( the '[' has to be first; the ']' has to be last; there have to be numbers in the middle, but I can't write an expression that fails if there is 1 or more spaces in the string.
Thanks!
Tay
Solved! Go to Solution.
11-20-2009 12:50 PM
11-20-2009 12:53 PM - edited 11-20-2009 12:54 PM
It needs to fail if there are 1 or more spaces, and if there are no numbers, and actually if there is more than one letter, so [test] needs to fail.
Tay
11-20-2009 01:13 PM
Several possibilities: Try this regular expression.
^\[[a-zA-Z]*[0-9]+[a-zA-Z0-9]*\]$
11-20-2009 01:15 PM
11-20-2009 01:17 PM
11-20-2009 01:26 PM