Text Processing9 / 14
Up next

-replace with regex

$date = "2026-09-21"
# 09/21/2026
$date -replace '(\d{4})-(\d{2})-(\d{2})', '$2/$3/$1'
What you're solving

regex replace, $1 backreference in the replacement