Multiple Regular Expression Matches on One Line

I have the following javascript regex

As used at http://regexpal.com/

\[.*(\.jpg|\.png|\.gif|\.bmp|\.jpeg).*\]

How to use jQuery code -

post.html().match(/\[.*(\.jpg|\.png|\.gif|\.bmp|\.jpeg).*\]/g);

This is an example of the data I'm working with.

  • [cid: image001.jpg@01CD2DC8.704399C0 ]
  • s [cid: image001.png@01CD2DC8.704399C0 ] <
  • image.jpg
  • [cid: image002.jpg@01CD2DC8.704399C0 ]
  • [cid: image002.exe@01CD2DC8.704399C0 ]
  • [cid: image002.gif@01CD2DC8.704399C0 ]
  • [[cid: image001.jpg@01CD2DE6.9802A2D0 ]
    And again
    [cid: image002.png @ 01CD2DE6.9802A2D0]]
  • test.gif

, 7 , , [], , ,

+5
1

, ( .*?):

\[.*?(\.jpg|\.png|\.gif|\.bmp|\.jpeg).*?\]
+8

All Articles