3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "Wheat Flour (2%) [Wheat Flour, Wheat Gluten, Calcium Carbonate, Iron, Niacin (B3), Thiamin (B1), Ascorbic Acid], Water, Yeast, Salt, Vegetable Oils (Palm, Rapeseed, oils (sunflower, rapeseed)), Soya Flour"; if (preg_match_all('~[^][(),\s][^][(),]*(?:\s*(?:(\[(?:[^][]++|(?1))*])|(\((?:[^()]++|(?2))*\))))*~', $text, $matches)) { print_r($matches[0]); }

preferences:
31.22 ms | 405 KiB | 5 Q