Regular Expressions 101

Community Patterns

URL Regex

1

Regular Expression
PCRE (PHP <7.3)

/
(?:ht|f)tps?:\/\/\w+\.\w{2}+[\/\w-.]+
/
gi

Description

An advanced URL regex for http(s) and ftp.

Submitted by Matthias WeiƟ - 8 years ago