$ ./guess_the_languageRegex
Regex · medium · #31

What does this expression return?

'$5, $10, €7'.match(/(?<=\$)\d+/g)
  1. ['5', '10']
  2. ['$5', '$10']
  3. ['5', '10', '7']
  4. ['7']
The lookbehind (?<=\$) keeps only numbers preceded by a dollar sign, without capturing the sign.
Play Regex ▸