View Single Post
Old Jul 30th, 2004, 5:27 PM   #1
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
As it ends up, it would appear that preg_replace actually has a limit to the size of the regular expression... this as you may know causes a bit of a problem, since I am writing a preparser for HTML pages which reads a very simple 'tag set' from an HTML file and replaces it with appropriate data (effectively producing a templating system which is REALLY easy for designers to understand and work with--without the need of a programming crash course).

The only problem is that I have one template that requires a really large section of code between an opening and closing 'if' tag to be replaces with a somewhat large table of data... and every time I run it, I get the following error:

Warning: Compilation failed: regular expression too large at offset 0 in ..... (ommited for security)

I can not find any information on google or php.net about there being a limit to the pattern size. Rewriting the code to work directecly with C/C++ style character streams is being avoided here, since PHP was not really intended for that purpose.

I am opening this thread for suggestion on how to get around this problem, any help would be appreciated. Thanks...
__________________
Clifford Matthew Roche <geek@cliffordroche.com>
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote