I can have /[abcd]/, /(ab|cd)/, and /[^wxyz]/. Why not /(^wx|yz)/
Apparently you can achieve an exactly identical effect by simply kludging the functionality together from other features, like so: /(?!wx|yz)../.
So why not just support the feature natively? Is there an underlying reason?
So, imagine that
(^wx|yz)means — as you apparently intend — “a two-character sequence that is neitherwxnoryz“. What would(^vwx|yz)mean? Would it mean “a two- or three-character sequence that is neithervwxnoryz“? Would it mean “either a three-character sequence that is notvwxand does not start withyz, or a two-character sequence that isyz“?The power of the character-class notation
[...]— what lets it support rangesa-z, what lets it support negation, etc. — is that it always matches a single character. As soon as you remove that restriction, it’s no longer clear what these things would mean.