While going through the ruby-doc for regular expressions, I came across this example for implementing the && operator:
/[a-w&&[^c-g]z]/ # ([a-w] AND ([^c-g] OR z))
# This is equivalent to:
/[abh-w]/
I understand that
/[a-w&&[^c-g]]/
would equate to
/[abh-w]/
because the "^" denotes symbols that should be excluded from the regular expression.
However, I am wondering about why "z" is not also included? Why was the equivalent regular expression NOT:
/[abh-wz]/
I am very new to regular expressions, much less any specifics for regular expressions within Ruby, so any help is greatly appreciated!