LearnPy Hub
← Regular Expressions problems
Medium

Reformat Dates

Read a line containing dates written DD/MM/YYYY. Print the line with every such date rewritten as YYYY-MM-DD, using groups in re.sub.

Input

One line.

Output

One line.

Sample 1

Input
Exam on 14/11/2026 and 01/12/2026
Output
Exam on 2026-11-14 and 2026-12-01

Sample 2

Input
no dates
Output
no dates
solution.py
Output appears here
Reformat Dates · Python practice problem · LearnPy Hub