help! strange preg_match no match problem!

wchenny <[email protected]>
Newsgroups gmane.comp.web.wiki.phpwiki.talk
Message-ID <[email protected]>
Hi, All,
I encountered this strange problem while using function preg_match in
InlineParser.php.
I isolates the problem and put it in the following php code.

</p>match result
<?php
$text = str_repeat('*', 12500);
$regexp = "/ ( . *? ) ( ($)|(~(?: [[:alnum:]]+ | .))|(\\#? \\[ .*? [^]
\\s] .*? \\]) ) /Asx";

if($text and $regexp)
  $ret = preg_match($regexp, $text, $m);

echo $ret;
?> <br />

</p>regexp is <?php echo $regexp; ?> <br />
</p>text length <?php echo strlen($text) ?> <br>
<?php   echo "count ".count($m)."<br>";
        for ($i=0; $i<count($m); $i++) {
        $str=$i.htmlentities($m[$i])."<br>";
        echo $str;
        } ?> <br /> 


when I set the line:
$text = str_repeat('*', 12500);

preg_match will return 0 for the hard coded regular expression.

but if I set $text to 12499, it will return 1 for a match.
$text = str_repeat('*', 12499);

anybody know what's the problem?

Thanks!



-- 
View this message in context: http://www.nabble.com/help%21-strange-preg_match-no-match-problem%21-tp18159550p18159550.html
Sent from the phpwiki-talk mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.