in reply to Re: Generating a format template for a date
in thread Generating a format template for a date
while(<DATA>){ s/9999/YYYY/; # 4-char year first s/(?<=[^9])99(?=[^9])/MM/; # month is always in the middle s/(?<!YYYY.{4})99$/RR/; # 2-char year is always at end, and won +'t have a 4-char year already s/99/DD/; # the remaining 2-chars will be the day print; } __DATA__ 99/99/9999 99/99/99 99-99-9999 99-99-99 99:99:9999 99:99:99 99+99+9999 9999-99-99 9999:99:99 9999+99+99
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Generating a format template for a date
by jbert (Priest) on Oct 13, 2006 at 18:01 UTC |