<?php
$str = '<[STRING]>';
$pattern = '#<(\[.*\])>#';
$str = preg_replace($pattern, '<this is '.$matches[1].'>', $str); endif;
echo $str;
PD9waHAKJHN0ciA9ICc8W1NUUklOR10+JzsKJHBhdHRlcm4gPSAnIzwoXFsuKlxdKT4jJzsKCmlmKHByZWdfbWF0Y2goJHBhdHRlcm4sICRzdHIsICRtYXRjaGVzKSk6Cgl2YXJfZHVtcCgkbWF0Y2hlcyk7Cgkkc3RyID0gcHJlZ19yZXBsYWNlKCRwYXR0ZXJuLCAnPHRoaXMgaXMgJy4kbWF0Y2hlc1sxXS4nPicsICRzdHIpOwplbmRpZjsKCmVjaG8gJHN0cjs=