- preg_match_all: documentation ( source)
<?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];