
Lynn Allan wrote:
But, in example 2, seems like "year" should be repeat<1,4>, but: year= repeat<1,2> works:
cregex date = (month= repeat<1,2>(_d)) // find the month ...
(delim= (set= '/','-')) // followed by a delimiter ... (day= repeat<1,2>(_d)) >> delim // and a day followed by the same delimiter ... (year= repeat<1,2>(_d >> _d)); // and the year.
actually, repeat<1,3> works for month, day, and year. Am I mixed up on what "repeat" means?
repeat