Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2016-06-06 10:17
Flavor·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
Open regex in editor

Description

no description available

Submitted by anonymous