Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Python

r"
^(?:(?P<protocol>http[s]?|ftp)(?::\/\/))?\/?(?P<address>(?P<hostname>[^\/\.]+)*?(?:\.)?(?P<domain>[^\/\.]+(?:\.[^:\/\s\.]+(\.[^:\/\s\.]+){0,1})?))(:\d+)?(?:$|\/)(?P<fullpath>(?P<path>[^#?\s]*?)(?:\/(?P<name>[^#?\/\s]*))?)(?:\?(?P<arg>.*?))?(?:#(?P<anchor>[\w\-]+))?$
"
mg

Description

no description available

Submitted by anonymous - 9 years ago