What does this expression return?
'a1b2c'.split(/(\d)/)
- ['a', '1', 'b', '2', 'c']
- ['a', 'b', 'c', '1', '2']
- ['a', '', 'b', '', 'c']
- ['a1', 'b2', 'c']
When the separator regex has a capturing group,
Play Regex ▸
split includes the captured text in the result.