Multiple choice technology programming languages

What will the output of: Regex.Replace("01/02/03","([0-9]+)/([0-9]+)/([0-9]+)","$2/$1/$3");

  1. Exception

  2. 02/01/03

  3. 03/02/01

  4. 01/02/03

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The regular expression defines three capturing groups for the numbers. The replacement pattern $2/$1/$3 swaps the first group (01) with the second group (02) while leaving the third (03) at the end.