Regular Expressions 101

Community Patterns

URL Regex

1

Regular Expression
PCRE (PHP <7.3)

/
(((http|https):\/{2})+(([0-9a-z_-]+\.)+([0-9a-z_-]+)(:[0-9]+)?((\/([~0-9a-zA-Z\#\+\%@\.\/_-]+))?(\?[0-9a-zA-Z\+\%@\/&\[\];=_-]+)?)?))
/
ium

Description

Modified version of the spoon library

Submitted by anonymous - 8 years ago