<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_epoch(_str):
 """Take incoming string, return its epoch."""

    _return = None
    if _str.startswith('A.D. '):
        _return = 'ad'
    elif _str.startswith('a. A.D. '):
        _return = None #?
    elif _str.startswith('p. A.D. '):
        _return = 'ad'
    elif regex.match(r'^[0-9]+ B\.C\. *', _str):
        _return = 'bc'
    elif regex.match(r'^a\. *[0-9]+ B\.C\. *', _str):
        _return = 'bc'
    elif regex.match(r'^p\. *[0-9]+ B\.C\. *', _str):
        _return = None  #?
    elif _str == 'Incertum' or _str == 'Varia':
        _return = _str
    return _return