You are fundamentally true, but [^b] will still match o and g in bog - this means that it is a successful match, although it does not match the entire string. [^bog] will match only h in hog , d in dog , and nothing in bog means that it does not match bog .
I think this will make more sense if you look ^[^b]+$ . This will match 1+ non b characters anchored to the beginning ( ^ ) and end ( $ ) of the string. Comparing this with your original expression [^b] or [^bog] , you can see the difference. I suggest using the RegEx GUI tester (the previously linked one of them is my favorite), which will really help illustrate the logic.
source share