Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
(?:(www\.))|(?:(?:^https:\/\/www\.)|(?:^https:\/\/)?)([\w]+){1}(?:\.[\w]+){2,}
/
ig

Description

Matches all subdomains (specifically in group 2) excluding www

Submitted by AurielleP - 7 years ago