Markdown Link Regex
Matches Markdown hyperlinks in [text](url) format.
パターン
/\[([^\]]+)\]\((https?://[^)]+)\)/g
→ ビジュアライザーで開くテスト例
Check out [Google](https://google.com) and [GitHub](https://github.com).
コード例
javascript
const regex = /\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g; const result = [...str.matchAll(regex)];
python
import re pattern = re.compile(r'\[([^\]]+)\]\((https?://[^)]+)\)') result = pattern.findall(text)
go
import "regexp" re := regexp.MustCompile(`\[([^\]]+)\]\((https?://[^)]+)\)`) result := re.FindAllString(text, -1)
markdownlinkparsing