Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does preg_match_all poop out after so many characters?
    text
    copied!<p>I'm having a problem with my preg_match_all statement. It's been working perfectly as I've been typing out an article but all of a sudden after it passed a certain length is stopped working all together. Is this a known issue with the function that it just doesn't do <em>anything</em> after so many characters?</p> <pre><code>$number = preg_match_all("/(&lt;!-- ([\w]+):start --&gt;)\n?(.*?)\n?(&lt;!-- \\2:stop --&gt;)/s", $data, $matches, PREG_SET_ORDER); </code></pre> <p>It's been working fine all this time and works fine for other pages, but once that article passed a certain length, poof, it stopped working for that article. Is there another solution I can use to make it work for longer blocks of text? The article that is being processed is about 33,000 characters in length (including spaces).</p> <p>I asked a question like this before but got only one answer which I never actually tested. The previous time I had just found another way to get around it for that particular scenario, but this time there is no way to get around it because it's all one article. I tried changing the <code>pcre.backtrack_limit</code> and <code>pcre.recursion_limit</code> up to even 500,000 with absolutely no effect. Are there any other ideas on why this is occurring and what I can do to get it to continue working even for these massive blocks of text? A 30,000 character limit seems to be a bit low, that's only 5,000-6,000 words (this one is about 5,700). Breaking it apart isn't really an option here because it won't find the start and stop if they are in two separate blocks of text.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload