Regular Expressions 101

Community Patterns

Community Library Entry

3

Regular Expression
Golang

`
^(?P<scheme>[^:\/?#]+):(?:\/\/)?(?:(?:(?P<login>[^:]+)(?::(?P<password>[^@]+)?)?@)?(?P<host>[^@\/?#:]*)(?::(?P<port>\d+)?)?)?(?P<path>[^?#]*)(?:\?(?P<query>[^#]*))?(?:#(?P<fragment>.*))?
`
gm

Description

Extract URL parts only named capturing groups

Submitted by dixanms - 3 years ago