Regular Expressions 101

Community Patterns

URL

2

Regular Expression
PCRE (PHP <7.3)

/
(https?:\/\/)?(w{3}\.)?(\w+\.\w{2,3}\.\w{2}?)?(\w+-)?(:?%?\w{2,}\/?\.\w{2,3})?(\/\w+)?(\/[\d\w].+\s$)?(:\d+)?
/
gi

Description

Matches the URL from the text to 95 percentage

Submitted by Harinath - 9 years ago