2004-12-10

Validating ISO 8601 input.

Ensures that everything is entered within valid ranges... just a shame I couldn't get this to check leap years as well ;)
/(?<=\A)(?(?=\d{2})(\d{0,2}\d{2})(?(?=-0?9|-0?4|-0?6|-11)-(\d{1,2})(?(?=-)-([0-2]?\d|30)(?(?=T)T([01]?\d|2[0-3])(?(?=:):([0-5]?\d)(?(?=:):([0-5]?\d)))))|-(0?\d|1[0-2])(?(?=-)-([0-2]?\d|3[01])(?(?=T)T([01]?\d|2[0-3])(?(?=:):([0-5]?\d)(?(?=:):([0-5]?\d)))))))Z(?=\Z)/

1 Comments:

Anonymous home equity loans said...

home equity loans

8:35 PM  

Post a Comment

<< Home