I'm trying to combine two separate regex queries into one default one in a small script I have.
The first query is
/\[(.*?)\]/g
Which matches shortcodes like this
[gallery]
The second query is
/\[([^\]]+)]([^\[]+)\[\/([^\]]+)]/g
Which matches shortcodes like this
[gallery]data[/gallery]
When I try to combine the queries, like this
/\[(.*?)\]|\[([^\]]+)]([^\[]+)\[\/([^\]]+)]/g
Everything is matched except the "data" inside an extended shortcode, like this.
[gallery]
[gallery][/gallery]
The result I am expecting / wanting to see is this
[gallery]
[gallery]data[/gallery]
