PHP's preg_match seems to be failing when the subject has too many characters in it.
This is my expression::
preg_match('/(.*<div id="storeArea">\s*)(.*)(\s*<\/div>\s*<!--POST-BODY-START-->.*)/si', $subject, $regs)
And here is the subject
<html>
<body>
<div id="storeArea">
<div>aaa ... </div>
<div>aaa ... </div>
<div>aaa ... </div>
</div>
<!--POST-BODY-START-->
<!--POST-BODY-END-->
</body>
</html>
It will match fine on that, but if the aaa .... is made HUGELY long, it won't match any more. I tested it with 80,000 a's in each line. If there was only one line (div tag) of A's, it would match, but it wouldn't match 3 lines of a's.
Is there a character limit to preg_match? Why would it behave like this? Can I fix the regular expression?
Thanks!
We're sending info to a php script. It is supposed to match a regular expression against the data.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.