The following snippet:
<?php
$text = <<<EOT
blah blah <0>
<RequestDetails><1><2><3>test</RequestDetails>
<RequestDetails><4><5><6>blah
more blah blah
</RequestDetails>
blah blah <7>
EOT;
print $text;
preg_match_all('/<RequestDetails>(.*?)<\/RequestDetails>/s', $text, $matches);
print_r($matches);
?>
Generates this output:
blah blah <0>
<RequestDetails><1><2><3>test</RequestDetails>
<RequestDetails><4><5><6>blah
more blah blah
</RequestDetails>
blah blah <7>
Array
(
[0] => Array
(
[0] => <RequestDetails><1><2><3>test</RequestDetails>
[1] => <RequestDetails><4><5><6>blah
more blah blah
</RequestDetails>
)
[1] => Array
(
[0] => <1><2><3>test
[1] => <4><5><6>blah
more blah blah
)
)
I've used preg_match_all instead of /g flag, and also used (.*?) reluctant matching, which is really what you want to get multiple matches.
To see why it makes a difference, in the following text, there are two A.*?Z matches, but only one A.*Z.
---A--Z---A--Z----
^^^^^^^^^^^
A.*Z
That said, parsing XML using regex is ill-advised. Use a proper XML parser; it'll make your life much easier.