Xref: utzoo comp.sources.wanted:11003 alt.sources.wanted:212 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!network.ucsd.edu!weber.ucsd.edu!pbiron From: pbiron@weber.ucsd.edu (Paul Biron) Newsgroups: comp.sources.wanted,alt.sources.wanted Subject: Wanted:C source for matching date strings Keywords: date strings, C source Message-ID: <2291@network.ucsd.edu> Date: 17 Mar 90 00:28:17 GMT Sender: nobody@network.ucsd.edu Reply-To: pbiron@ucsd.edu (Paul Biron) Organization: Division of Social Sciences, UCSD Lines: 66 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