$testStr = '<entry>
<author>
<name>Dunnock_D</name>
<uri>http://www.flickr.com/people/dunnock_d/</uri>
</author>
<link rel="license" type="text/html" href="https://creativecommons.org/licenses/by-nc/2.0/deed.en" />
<link rel="enclosure" type="image/jpeg" href="http://farm8.staticflickr.com/7548/26820724620_1d221c3187_b.jpg" />
</entry>';
$regExp = "#enclosure(?:.*?)href=\"(.*?)\"#si";
preg_match_all($regExp, $testStr, $matches, PREG_SET_ORDER);
print_r($matches);
$testStr = "[controller1]/[action1]/[id1]
[controller2]/[action2](/[id2])
[controller3]/[action3]/[id3]";
$regExp =
"#\[([a-z\d]+)\]\/\[([a-z\d]+)\]".
"(?:".
"(?:\(.*?\))".
"|".
"(?:\/\[([a-z\d]+)\])".
")".
"#si";
preg_match_all($regExp, $testStr, $matches, PREG_SET_ORDER);
print_r($matches);