Regular Expressions 101

Community Patterns

[php] url hard match

1

Regular Expression
PCRE (PHP <7.3)

/
((?:(?:https?|ftp)+(?:\:\/\/))?)+(?:(?:(?:www(?:(?:[\d]{1})?)\.|[a-z0-9-_]{1,}))+\.(?:com|me|ru|net|biz|info|fm|su|ua|to|us|[a-z]{1,5}))+(?:(?:[a-z0-9\/\?=-_.&]{1,})?)
/
ism

Description

preg_math_all only. ex.: http://doman.com, http://doman.com/, http://doman.com/?query=1,http://doman.com?query=1, domain.com, doman.com?query=1 and other

Submitted by Redfern.89 - 9 years ago