3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/(?<=\])(.*?)(?=\[\/)/m'; $str = '[test_tag with="attributes"]Content I [want] To capture[/test_tag]'; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); // Print the entire match result echo $matches[0][0];

preferences:
21.61 ms | 404 KiB | 5 Q