🎴 Flashcard Mode

Programming Languages: C, Java, .NET/WCF & Regex

Card1 / 20
Mastered0
Review0
QuestionClick to flip

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

AnswerClick to flip back
A
02/01/03
💡 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.

Change Mode