$ ./guess_the_languageRegex
Regex · hard · #33

What does this expression return?

'abc'.replace(/(?=b)/, '-')
  1. 'a-bc'
  2. 'a-c'
  3. 'ab-c'
  4. '-abc'
A lookahead matches an empty position, so the replacement is inserted before "b" without removing it.
Play Regex ▸