PHP preg_match_all fails on long strings
<p>Here's my code:</p>

<pre><code>$long = str_repeat('a very long string text', 100); // try changing 100 to 5000

$str = &lt;&lt;&lt;STR
&lt;abc&gt;a short string text&lt;/abc&gt;
&lt;abc&gt;$long&lt;/abc&gt;
STR;

preg_match_all('@&lt;abc&gt;([^&lt;&gt;]+)&lt;/abc&gt;@sU', $str, $matched);

print_r($matched);
</code></pre>

<p>And it works totally as expected. However, after you have changed 100 repetitions to 5000, run</p>

<pre><code>print_r($matched);
</code></pre>

<p>And you will only get results for the short string occurrence.</p>

<p>My question is how to make preg_match or preg_match_all to work with large string texts (as large as 1MB or larger)?</p>
