in reply to Re^4: Pattern matching when there are exception strings
in thread Pattern matching when there are exception strings

[] is not zero-width. It has to match one or more characters.

I'm only going to mention this to help avoid any confusion among newbies who may find this post sooner or later... Without a quantifier (*, +, {}, ?) it must match exactly one character.

It might be clearer if you leave out assertions altogether and just show how character classes compare to literal characters. (If someone doesn't understand how character classes work, it probably isn't the right time to confuse them with zero-width assertions.) Start by explaining that /a/ is equivalent to /[a]/, progress by explaining that /[ab]/ is similarly equivalent except that it will match a 'b' as well, and then leap to the fact that /[^a]/ will simply match any character that is not an 'a'.

-sauoq
"My two cents aren't worth a dime.";