Text Processingflags: g

Markdown Link

Match Markdown links [link text](url) and capture both the display text and the URL.

Try it in RegexPro

Pattern

regexJavaScript
/\[([^\]]+)\]\(([^)]+)\)/g

Raw source: \[([^\]]+)\]\(([^)]+)\)

How it works

Group 1 captures the link text inside square brackets (any chars except ]). Group 2 captures the URL inside parentheses (any chars except )).

Examples

Input

[RegexPro](https://regexpro.dev)

Matches

  • [RegexPro](https://regexpro.dev)

Input

[Click here](https://example.com/path)

Matches

  • [Click here](https://example.com/path)

Common use cases

  • Markdown parser implementation
  • Link extraction from .md files
  • Documentation link checking
  • Static site generator tooling
All patternsTest this pattern live →