

def regex(text, pattern):
    'Take text and a Regular Expression using a group named scrape, and return match.'
    if (text[:4].lower() == 'http'):
        text = requests.get(text).text
    match = re.search(pattern, text, (re.S | re.I))
    if match:
        if ('scrape' in match.groupdict().keys()):
            return match.group('scrape')
    else:
        return None

dataset/ETHPy150Open miklevin/pipulate/common.py regex/original