| 
	
 | 
 Posted by Andy Hassall on 07/07/84 11:57 
On 4 Sep 2006 14:21:09 -0700, "Clodoaldo Pinto" <clodoaldo.pinto@gmail.com> 
wrote: 
 
>preg_match(): Compilation failed: regular expression too large at 
>offset 0 
> 
>The regular expression is 34,745 bytes long. 
> 
><?php 
>$regExp = 'huge regexp with 34,745 bytes'; 
>echo '<pre>strlen($regExp) = ', strlen($regExp), "\n"; 
>echo preg_match($regExp, 'sudokusweb.com'); 
>echo '</pre>'; 
>?> 
> 
>This error shows in Fedora Core 5 - PHP 5.4.1 
> 
>The same code works in a shared host running PHP 4.3.11: 
> 
>http://allthehosts.com/testregex.php 
> 
>The code including the regexp can be downloaded from: 
> 
>http://allthehosts.com/testregex.txt 
 
 
 See the LIMITATIONS section of http://www.pcre.org/pcre.txt 
 
 There are compile-time options that may allow longer expressions, possibly 
these differ between the two sites. 
 
 However, that's one big beastie of an expression, most of which is just 
alternation - you *could* run it as a series of smaller expressions. 
 
--  
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk 
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
 
  
Navigation:
[Reply to this message] 
 |