Regular Expressions 101

Community Patterns

1...34567...901

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(https?:\/\/)?.+\.[^\/]{2,25}.*$
/

Description

Matches all valid URLs. Does not match things such as mailto:someone@example.com and http://a.b/.

Submitted by StellarDoor5319 - 7 years ago