Regular Expressions 101

Community Library Entry

1

Regular Expression
Python

r"
^(http[s]?:\/\/)?([^:\/\s]+)(:([^\/]*))?(\/\w+\.)*([^#?\s]+)(\?([^#]*))?(#(.*))?$
"
i

Description

Break a URL into parts: protocol url path get parameters hash

Submitted by Dale O'Brien - 10 years ago