code: def with_pattern(pattern, regex_group_count=None):
      
      def decorator(func):
          func.pattern = pattern
          func.regex_group_count = regex_group_count
          return func
      return decorator
docs: Attach a regular expression pattern matcher to a custom type converter
      function.
  
      This annotates the type converter with the :attr:`pattern` attribute.
  
      EXAMPLE:
          >>> import parse
          >>> @parse.with_pattern(r"\d+")
          ... def parse_number(text):
          ...     return int(text)
  
      is equivalent to:
  
          >>> def parse_number(text):
          ...     return int(text)
          >>> parse_number.pattern = r"\d+"
  
      :param pattern: regular expression pattern (as text)
      :param regex_group_count: Indicates how many regex-groups are in pattern.
      :return: wrapped function