Fix empty character classes like [^] and allow matching for /]/