tags:

views:

33

answers:

1

I have a text field and am looking to have if be valid for all values other than "NONE" without the quotes. I know a comparison would be easy but the system I am using only validates via RegEx expressions. What would the RegEx expression be for it?

+2  A: 

Use a negative lookahead:

^(?!NONE$)

What this means is find me the starting anchor that isn't followed by "NONE' and then terminator. So it should match anything else.

cletus
Thanks, this worked perfectly!
Justin808