Regular Expressions 101

Community Patterns

1...56789...902

Community Library Entry

2

Regular Expression
PCRE2 (PHP >=7.3)

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

Description

Port https://regex101.com/library/cX0pJ8 to PCRE2 (PHP >= 7.3)

Submitted by semivori - 4 years ago