Community Patterns

Community Library Entry

0

Regular Expression
Created·2023-01-26 12:42
Flavor·ECMAScript (JavaScript)

/
^(?:https?:\/\/)?([-\w.]+\.[\w]+){1}(\/[\/\d\w\.\-\?\+\&\#\=\~]*)?$
/
gi
Open regex in editor

Description

This regex is used to extract a domain name (including subdomains) and the full URI from a URL. will not match when credentials are provided in the url.

Submitted by anonymous