def _getYearCentRE(cent=(0, 3), distance=3, now=(MyTime.now(), MyTime.alternateNow)):
 cent = (lambda year, f=cent[0], t=cent[1]: str(year)[f:t])
 exprset = set((cent((now[0].year + i)) for i in ((-1), distance)))
 if (len(now) and now[1]):
  exprset |= set((cent((now[1].year + i)) for i in ((-1), distance)))
 return (('(?:%s)' % '|'.join(exprset)) if (len(exprset) > 1) else ''.join(exprset))

def _getYearCentRE ( cent = ( 0 , 3 ) , distance = 3 , now = ( MyTime . now ( ) , MyTime . alternateNow ) ) : cent = ( lambda year , f = cent [ 0 ] , t = cent [ 1 ] : str ( year ) [ f : t ] ) exprset = set ( ( cent ( ( now [ 0 ] . year + i ) ) for i in ( ( - 1 ) , distance ) ) ) if ( len ( now ) and now [ 1 ] ) : exprset |= set ( ( cent ( ( now [ 1 ] . year + i ) ) for i in ( ( - 1 ) , distance ) ) ) return ( ( '(?:%s)' % '|' . join ( exprset ) ) if ( len ( exprset ) > 1 ) else '' . join ( exprset ) )
build century regex for last year and the next years .