import re


def JB_name_2_run_ids(JB_name, regex='\d+'):
    """
    Returns observation run ID (Night and Run). Expects the first digit in the
    JB_name to be the fNight and the second digit to be the fRunID.
    """
    p = re.compile(regex)
    digits = p.findall(JB_name)
    assert len(digits) >= 2
    return {'fNight': int(digits[0]), 'fRunID': int(digits[1])}