Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Python

r"
(http|https|ftp)\://([a-zA-Z0-9\-\.]+\.+[a-zA-Z]{2,3})(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&%\$#\=~]*)[^\.\,\)\(\s]?
"
g

Description

gets the <protocol>://<host>:<port>/<link> from am url

Submitted by anonymous - 10 years ago