Community Patterns

Community Library Entry

0

Regular Expression
Created·2021-02-01 04:30
Flavor·ECMAScript (JavaScript)

/
(?:(?<Protocol>https?):\/\/)?(?:(?<Subdomain>[\w\.]+)?\.)?(?<Hostname>\w+)\.(?<Domain>\w+)\:?(?<Port>\d+)?(?<Path>\/.*)?
/
g
Open regex in editor

Description

Validate (although, not recommended) URI scheme, and separate the URI syntax with multiple groups.

Submitted by outrowed