3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/^\h*\\\\_+\\\\_\R((?:.*\R(?!\h*\\\\_+\\\\_).*)*)/m'; $str = '--- - ID: some random id \\_______________________________\\_ HELLO This is an example text. I AM SECTION 1 \\_______________________________\\_ HELLO This is an example text. I AM SECTION 2 \\_______________________________\\_ HELLO This is an example text. I AM SECTION 3 \\_______________________________\\_ hello this is example text here and i am section 4'; preg_match_all($re, $str, $matches); print_r($matches[1]);

preferences:
58.63 ms | 402 KiB | 5 Q