#!/bin/bash
s='[![](https://i...content-available-to-author-only...d.com/comics/git.png)](https://i...content-available-to-author-only...d.com/comics/git.png)

a lot of text 
some more text...

[![](https://1...content-available-to-author-only...t.com/-Ze2SiBflkZ4/XbtF1TjELcI/AAAAAAAALL4/IDC6W-b5moU0eGu2eN60aZ4pxfXW1ybmQCLcBGAsYHQ/s320/take_a_break_git.gif)](https://1...content-available-to-author-only...t.com/-Ze2SiBflkZ4/XbtF1TjELcI/AAAAAAAALL4/IDC6W-b5moU0eGu2eN60aZ4pxfXW1ybmQCLcBGAsYHQ/s1600/take_a_break_git.gif)


some more text

another URL but not image
[https://g...content-available-to-author-only...b.com]

so on'
grep -Eo "https?://[^][ ]+\.(jpg|png|gif)" <<< "$s"