def regexp_extract(pattern, method=re.match, group=1):

  def regexp_extract_lambda(value):
    if not value:
      return None
    matches = method(pattern, value)
    if not matches:
      return None
    return matches.group(group)

  return regexp_extract_lambda
Return first group in the value matching the pattern using re.match.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/bulkload/transform.py/regexp_extract