It's not a bug. +(pattern) matches one or more occurrences of the pattern. +(2|3) will match any combination and any number of 2's and 3's: 2, 3, 23, 32, 222, 333, 3223232323—any of those.
If you want strict alternation without repeats, change + to @:
ab@(2|3)
(Or just use ab[23]. That doesn't even require extglob.)
It's not a bug.
+(pattern)
matches one or more occurrences of the pattern.+(2|3)
will match any combination and any number of2
's and3
's:2
,3
,23
,32
,222
,333
,3223232323
—any of those.If you want strict alternation without repeats, change
+
to@
:(Or just use
ab[23]
. That doesn't even requireextglob
.)