Regex to split BBCode into pieces
I have this:
str = "some html code [img]......[/img] some html code [img]......[/img]"
and I want to get this:
["[img]......[/img]","[img]......[/img]"]
I have this:
str = "some html code [img]......[/img] some html code [img]......[/img]"
and I want to get this:
["[img]......[/img]","[img]......[/img]"]
Answers 1
Keep in mind that this is a very specific answer that is based on your exact question. Change
str
by, say, adding an image tag within an image tag, and all Hell will break loose.