Regular Expressions 101

Community Patterns

Community Library Entry

5

Regular Expression
PCRE (PHP <7.3)

/
<a.+?\s*href\s*=\s*["\']?([^"\'\s>]+)["\']?
/
gi

Description

Find all href in a tag

Submitted by Miron Yanovskiy - 11 years ago