Regular Expressions 101

Parse a HTML URL

Open Workspace
  • Python
  • Match
1

Regular Expression

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

Description

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

Submitted by Dale O'Brien