PATTERN , , , ( , , _); - , undef . , , , (.. , ), count LIMIT. , ( ):
split(/-|,/, "1-10,20", 3) # ('1', '10', '20')
# No retention, '-', ',' consumed
split(/(-|,)/, "1-10,20", 3) # ('1', '-', '10', ',', '20')
# Split on and retain '-' or ','
# 5 elements returned
split(/-|(,)/, "1-10,20", 3) # ('1', undef, '10', ',', '20')
# undef because '-' matches
split(/(-)|,/, "1-10,20", 3) # ('1', '-', '10', undef, '20')
# undef because ',' matches
split(/(-)|(,)/, "1-10,20", 3) # ('1', '-', undef, '10', undef, ',', '20')
# one match per capturing group. (-) matches -, but
# (,) returns undef on trying to match -.
# 7 elements (!)