import re


def regex(text, pattern):
  """Take text and a Regular Expression using a group named scrape, and return match."""
  match = re.search(pattern, text, re.S | re.I)
  if match:
    if "scrape" in match.groupdict().keys():
      return match.group("scrape")
  else:
    return None