Is anybody aware of a third-party package that directly finds portions of an input string that match a Java DateFormat? In other words, that converts a DateFormat to a regular expression?
E.g., it might convert;
DateFromat df = new SimpleDateFormat("MM/dd/yyyy")
to something like "(0[1-9]|1[0-2])\\/(0[1-9]|1[0-9]|2[0-9]|3[01])\\/([0-9]{4})"
so that you would have seamless methods available like (fantasy code):
DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
DateMatcher dm = df.dateMatcher(inputString);
while (dfm.findDate()) {
#dostuff
}; // or
if (dfm.matchesDate()) #dosomething