Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(https?:\/\/)?([\da-z-]+\.)+([a-z]{2,6})?(\/([a-z0-9+\$_-]\.?)+)*\/?$
/

Description

this is the most perfect pattern I reach for url with query or anchor

Submitted by Gehad Mohamed - 9 years ago