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
In reply to Re^2: Generating a format template for a date
by davidrw
in thread Generating a format template for a date
by bart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |