How get the text inside a custom bbcode,
[gallery] get this text [/gallery].
I am using this regex but it wont work
/^(.*)\[gallery.*?\[\/gallery\](.*)$/gmi
(new) try :
/\[gallery\](.*)\[\/gallery\]/g
to return the value use
var result = str.match(regex); alert(result[1]);
str.replace(/[gallery](*.)+[\/gallery]/i, '\$1')? after the greedy * to make it look like /\[gallery\](.*?)\[\/gallery\]/g.It looks like there may be some attributes after inside your tag.
Try this:
/\[gallery[^\]]*\](.*)\[\/gallery\]/gi