in reply to Regexp - groupings
Using *, + and similar on a capture doesn't make much sense, and therefore neither does the result. If you wished to capture the separator, you should have used
@num = split /((?:a|b)+)/, $x; # @num = ('12','aba','34','ba','5')
|
|---|