chlkdst
chlkdst

Reputation: 197

Capture markdown image syntax on a single line

I'm using this regular expression

\!\[.*\]\[(.*)\]

to capture image syntax tags for markdown. However, whenever I encounter a paragraph with more than 1 markdown image syntax on it, regex only considers it only as one image syntax.

Upvotes: 1

Views: 285

Answers (1)

Victor Dodon
Victor Dodon

Reputation: 1864

You may try:

\!\[[^\]]*\]\[([^\]]*)\]

or

\!\[.*?\]\[(.*?)\]

Upvotes: 1

Related Questions