Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

~
\b(?:https?://)?(?:(?i:[a-z]+\.)+)[^\s,]+\b
~
g

Description

This will help you to extract any URL inside your text

Submitted by Abdullah Alweheid - 2 years ago