PyXURLs

A regular expression based URL extractor which extracts URLs from text.
Thanks to Daniel Martí invests the project mvdan/xurls. This python project developed by the same concept as the golang version.
Installing
pip install google-re2 pyxurls
Usage
import xurls
extractor = xurls.Strict()
url = extractor.findfirst('we have the link with scheme https://www.python.org and https://www.github.com')
urls = extractor.findall('we have the link with scheme https://www.python.org and https://github.com')
import xurls
extractor = xurls.Relaxed()
url = extractor.findfirst('we have the link with scheme www.python.org and https://www.github.com')
urls = extractor.findall('we have the link with scheme www.python.org and https://github.com')
import xurls
extractor = xurls.StrictScheme('https://')
url = extractor.findfirst('we have the link with scheme custom://domain.com and https://www.python.org noscheme.com')
extractor = xurls.StrictScheme(xurls.express.ANY_SCHEME)
urls = extractor.findall('we have the link with scheme custom://domain.com and https://www.python.org noscheme.com')