def mention_id(mention): match = ID_RE.match(mention) if match is not None: return int(match.group(1))