$ ./guess_the_languageRegex
Regex · medium · #45

Which PATTERN captures only the first bracketed value?

'[a][b]'.match(PATTERN)[1] === 'a'
  1. /\[(.*?)\]/
  2. /\[(.*)\]/
  3. /\[(.+)\]/
  4. /\[(.)*\]/
The lazy .*? stops at the first ]; the greedy forms run on to the last one.
Play Regex ▸