Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

~
(?: (https?) :/{2} )? ( \w+ (?:\.\w+)+ )
~
gxu

Description

Matches the protocol (http/https) if available and full domain name.

Submitted by OnlineCop - 8 years ago