$ ./guess_the_languageRegex
Regex · hard · #26

What does this expression return?

'bookkeeper'.match(/(\w)\1/g)
  1. ['oo', 'kk', 'ee']
  2. ['o', 'k', 'e']
  3. ['oo']
  4. ['bo', 'ok', 'ke']
The backreference \1 must repeat whatever group 1 captured, so it finds doubled letters.
Play Regex ▸