code: def regexNamer(regex, usePageUrl=False):
      
      @classmethod
      def _namer(cls, imageUrl, pageUrl):
          """Get first regular expression group."""
          url = pageUrl if usePageUrl else imageUrl
          mo = regex.search(url)
          if mo:
              return mo.group(1)
      return _namer
docs: Get name from regular expression.