def single_search(regex, string, default=None):
    """First-match search of a string given a regex. Catch non-match into default."""
    match = regex.search(string)
    if not match:
        return default
    return match.group(0)