def _url(regex, text):
match = re.match(regex, text)
if match:
url = match.group('url')
# Remove end of line full stop character.
url = url.rstrip('.')
# Remove closing tag markdown link e.g. [title](url)
url = url.rstrip(')')
# Remove closing tag markdown image e.g. ]
if url[-2:] == ')]':
url = url[:-2]
return url
return None
评论列表
文章目录