Link to home
Start Free TrialLog in
Avatar of jfredrickson
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.
ASKER CERTIFIED SOLUTION
Avatar of amit_g
amit_g
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jfredrickson
jfredrickson

ASKER

Is there no way to only specify that you don't want that specific character?
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).