$ ./guess_the_languageRegex
Regex · medium · #25

What does this expression return?

'06/2024'.replace(/(?<m>\d+)\/(?<y>\d+)/, '$<y>-$<m>')
  1. '2024-06'
  2. '06-2024'
  3. '$<y>-$<m>'
  4. '2024/06'
Named groups (?<name>...) can be referenced in a replacement string with $<name>.
Play Regex ▸