$ ./guess_the_languageRegex
Regex · medium · #28

What does this expression return?

'a1b2c'.split(/(\d)/)
  1. ['a', '1', 'b', '2', 'c']
  2. ['a', 'b', 'c', '1', '2']
  3. ['a', '', 'b', '', 'c']
  4. ['a1', 'b2', 'c']
When the separator regex has a capturing group, split includes the captured text in the result.
Play Regex ▸