<?php
$uri = "[Test1] Title [Test9].jpg";
$str = "'".$uri."'";
if (preg_match('/\[(.+?)\]/', $str, $matches)) {
    echo "[".$matches[1]."]";
}
