निम्नलिखित कोड पायथन रेगेक्स का उपयोग करके HTML लिंक से URL निकालता है।
उदाहरण
import re
s = '''https://www.santa.com'''
match = re.search(r'href=[\'"]?([^\'" >]+)', s)
if match:
print match.group(0)
आउटपुट
यह आउटपुट देता है
href="https://www.santa.com"