It doesn't work for me... I'm not using preg_match_all (nor do I need to capture anything) because I only need to find out IF there is anything other than only whitespace in-between the tags:
$data = "</pre>
stuff here
and maybe here
<pre>";
if ( preg_match( '#</pre>\s*\S+\s*<pre>#s', $data, $matches ) )
{
echo "IT MATCHES: '{$matches[0]}'";
}
else
{
echo "NO MATCH";
}
// outputs "NO MATCH"
It seems to be stopping at the first space after 'stuff'... as you can see if you change the pattern to '#</pre>\s*\S+#s'
What makes it difficult, I suppose, is that the stuff in-between the tags is likely to contain multiple lines... and the \S trips up on the spaces in the lines. We need to find a way to find "anything BUT ONLY whitespace" which is different that "anything but whitespace".