def regexp_bool(regexp, flags=0):
 def transform_function(value):
  return bool(re.match(regexp, value, flags))
 return transform_function

def regexp_bool ( regexp , flags = 0 ) : def transform_function ( value ) : return bool ( re . match ( regexp , value , flags ) ) return transform_function
return a boolean if the expression matches with re .