Regular Expressions 101

Community Patterns

Extract URL and Text Title from Web Page

0

Regular Expression
PCRE (PHP <7.3)

/
<a (?:.*?)href="(.+)">(.+)<\/a>
/
g

Description

Uses a list of anchor tags, perhaps embedded in other tags Allows for any, or no text between the "<a" and the "href"

Submitted by anonymous - 7 years ago