Regular Expressions 101

Community Patterns

Simple HTML to Markup

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 - 2 years ago