fork(2) download
  1. #!/bin/bash
  2. 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)
  3.  
  4. a lot of text
  5. some more text...
  6.  
  7. [![](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)
  8.  
  9.  
  10. some more text
  11.  
  12. another URL but not image
  13. [https://g...content-available-to-author-only...b.com]
  14.  
  15. so on'
  16. grep -Eo "https?://[^][ ]+\.(jpg|png|gif)" <<< "$s"
Success #stdin #stdout 0s 4896KB
stdin
Standard input is empty
stdout
https://i...content-available-to-author-only...d.com/comics/git.png
https://i...content-available-to-author-only...d.com/comics/git.png
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