def regexNamer(regex, use_page_url=False):
    """Get name from regular expression."""
    def _namer(self, image_url, page_url):
        """Get first regular expression group."""
        url = page_url if use_page_url else image_url
        mo = regex.search(url)
        if mo:
            return mo.group(1)
    return _namer