jfredrickson
asked on
Not Allowing Specific Character in Regular Expression
Is it possible to specify that you don't want a specific character at a specific position in a regular expression?
In otherwords I want it to return true if the string is "blahblahblah" but not if it is blahblahblah[" and only that one character should be disallowed.
In otherwords I want it to return true if the string is "blahblahblah" but not if it is blahblahblah[" and only that one character should be disallowed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Doh! Misread that. Looks perfect, thanks.
Thats exactly what it is. [^[] would match any character but [ i.e. the reg ex would not match if there is a [ in it (in turn disallowing it).
ASKER