pbiron@weber.ucsd.edu (Paul Biron) (03/17/90)
I have an application that needs to do validation on dates in string form. The format of the date string can include any of the following : 19xx xx Month 19xx Month, 19xx Month xx Month, xx Month, date, 19xx Month date, 19xx Month, date 19xx Month date xx Month, date xx Month date, xx month_num/date/19xx month_num/date/xx date/month_num/19xx date/month_num/xx 19xx/date/month_num xx/date/month_num 19xx/month_num/date xx/month_num/date month_num-date-19xx month_num-date-xx date-month_num-19xx date-month_num-xx 19xx-date-month_num xx-date-month_num 19xx-month_num-date xx-month_num-date month_num.date.19xx month_num.date.xx date.month_num.19xx date.month_num.xx 19xx.date.month_num xx.date.month_num 19xx.month_num.date xx.month_num.date with any other chars surrounding these strings. The main job is to (once it is assured that the string is a date) to extract the *YEAR* portion. Has anyone written such code before? I'm sure I could do it if I had to, but why re-invent the wheel? Besides, I'm not looking forward to dealing with ambiguous cases like : 10/12/11 Any pointers would be appreciated. ----------------- Paul Biron (pbiron@ucsd.edu) Social Sciences DataBase Project Central Univesrity Library University of California, San Diego La Jolla, Ca. (619) 534-5758 If you think the United States has stood still, who built the largest shopping center in the world? -- Richard Nixon