code: def regex_condition(func):
      
      @wraps(func)
      def regex_condition_wrapper(condition, *args, **kwargs):
          if isinstance(condition, string_types):
              condition = maybe | partial(re.match, condition)
          return func(condition, *args, **kwargs)
      return regex_condition_wrapper
docs: If a condition is given as string instead of a function, it is turned
      into a regex-matching function.