Regular Expressions 101

Community Patterns

123...7

Markdown link

1

Regular Expression
.NET 7.0 (C#)

@"
(?:(?:\[(?<text>.*)\])(?:\((?<url>https?\:\/\/.*?)(?:\s\"(?<alt>.*?)\"\)|\)))|(?<text>(?<url>https?\:\/\/\S*)))
"
gm

Description

Regex for parsing markdown link. Named group "text", "url" and "alt.

Submitted by anonymous - 2 years ago