#!/usr/bin/env perl use strict; use warnings; my $date = "3-15-1932" $date=~ s/(\d+)-(\d+)-(\d+)/$3-\/sprintf("%02d",$1)\/-$2/ge; print $date; #Want to print like this: 1932-03-15
In reply to Using sprintf in regular expreession. by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |