Regular Expressions 101

Community Patterns

urls and emails

0

Regular Expression
PCRE (PHP <7.3)

/
((([a-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[\w.-]+|(?:www.|[-;:&=\+\$,\w]+@)[\w.-]+)((?:\/[\+~%\/.\w_-]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)
/
ig

Description

no description available

Submitted by Matthew O'Riordan - 9 years ago