Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2021-01-22 03:50
Flavor·ECMAScript (JavaScript)

/
^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/?\n]+)
/
igm
Open regex in editor

Description

Extracts and returns the domain name from a given URL.

Submitted by anonymous