
from re import search, compile

_predicate_re = re.compile('\).+?(;|,)[ ]*\d+/\d+')
_replace_re = re.compile('\d+/\d+.*', convert_key)
    
def key_transform(key):
    '''Step 1B format key:
    HOWEVER, if any of these two pairs occur in a string
        ')'              and                     '; #/#'
        ')'              and                     ', #/#'
    DO NOT CONSIDER ANYTHING AFTER THE #/#
    '''
    
    if _predicate_re.search(key):
        replace = _replace_re.search(key)
        return convert_key.replace(replace.group(), '')