Modify a reference numbered group to match against
- by StuperUser
I want to match YYYY-YY for sequential years.
I at moment I'm trying to match where all the second YY is the 3rd and 4th characters in YYYY with 1 added to it.
So far I've got {19|20}(\d{2})-(\d{2}), but not sure how to use ? with reference to (1) or whether I'm going about this the right way and finding out the inevitable "unknown unknowns" (like YY99) with this approach?
Edit:
Matches: 2010-11,2011-12,2029-30
Not matches: 2010-12, 2010-09,2011-2,2011-2012