Regular Expressions 101

Community Library Entry

1

Regular Expression
Python

r"
(.*?)<a .*?href=\"(.*?)\".*?>(.*?)</a>(.*)
"
gm

Description

  • converts HTML: This is <a href="https://www.google.com">hyperlink</a>. You can click this.
  • to Markup: This is [hyperlink](https://www.google.com). You can click this.
  • which renders like this: This is hyperlink. You can click this.
Submitted by toryano0820 - 3 years ago