Regular Expressions 101

Community Patterns

Convert <a href="x">y</a> to [url=x]y[/url]

0

Regular Expression
PCRE (PHP <7.3)

/
<a (.*)href="([^"]*)"(.*)>(.*)<\/a>
/
gm

Description

it took me quite some time to figure out. I hope it'll be helful to someone else.

Submitted by anonymous - a year ago