Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
https?:\/\/[\/\\]*(www\.)?
/
gm

Description

https:// http:// https://// https://///
https:////

The reason I include [/\]* is because some links like: https:///////www.google.com actually work.

Submitted by anonymous - 3 years ago