3v4l.org

run code in 300+ PHP versions simultaneously
<?php //I want the 'delimX' to be included as well: $str = "It seems entirely 1 (b natural b) to us that there are teams of scientists in universities and other institutions around the world, attempting to 2 (b discover b) the way the world works. However, it hasn't always been that 3 (b way b) . Although the scientific method is now four or five hundred years old, the ancient Greeks, for example, believed that they could work out the 4 (b causes b) of natural events just by the power of thought."; $result = preg_split ('~([0-9 ]\(b.*?b\))~',$str ,-1, PREG_SPLIT_DELIM_CAPTURE); var_dump($result);

preferences:
49.93 ms | 402 KiB | 5 Q