in reply to Possible with a regex?

Some basic loop-unrolling: (untested)
m{\[img]([^[]*(?:\[(?!img])[^[]*)*)\[/img]}g