I have simple script, I want to get my images and then divide them by commas. However I cannot get image links inside
def
</textarea>
JavaScript
$(function(){
var text = $('textarea').val();
var re = /\([^}]+)[/gallery\]/g;
var gallery = re.exec(text);
alert(gallery);
});
Fiddle: http://jsfiddle.net/BcFsg/
see the updated fiddle… I do not know why but it seems you do not have to escape the closing
]EDIT: gave wrong output (all squared brackets need to be escaped)… updated fiddle
EDIT 2: updated fiddle to only alert the list of images
fiddle