You are here: Re: preg_match(): Compilation failed: regular expression too large « PHP Programming Language « IT news, forums, messages
Re: preg_match(): Compilation failed: regular expression too large

Posted by Andy Hassall on 10/18/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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация