Text Processingflags: g

Markdown Image

Matches Markdown image syntax ![alt](url).

Try it in RegexPro

Pattern

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

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

How it works

`!\[([^\]]*)\]` captures the alt text inside brackets. `\(([^)]+)\)` captures the URL in parentheses.

Examples

Input

![logo](https://example.com/logo.png)

Matches

  • ![logo](https://example.com/logo.png)

Input

![](image.jpg) and ![alt](pic.gif)

Matches

  • ![](image.jpg)
  • ![alt](pic.gif)

Common use cases

  • Markdown rendering
  • Image extraction
  • Link validation