PHP error, preg_replace?

Posted on 2008-11-16
Medium Priority
Last Modified: 2013-12-13
I get this error message when posting certain message in my site, its a contacts board, and the content of the text is not being stored in the database, so this is a crytical error :( how can i solve this?

I also sen attached the code in config.php

Warning: preg_replace() [function.preg-replace]: Compilation failed: POSIX named classes are supported only within a class at offset 21 in /mounted-storage/home43a/sub004/sc31952-BMDX/www/contacts/config.php on line 725

function FilterMessage($message){
//eregi_replace( "^([_\.0-9a-z-]+)@([0-9a-z][0-9a-z-]+)\.([a-z]{2,6})$", '\\1 at \\2 dot \\3',$message);
$message = preg_replace("#(\w|\.)+?@(\w|\.)+?\.[:a-z:]{2,4}?#is","##",$message); //eliminate email addresses(this is line 725)
$message = strip_tags($message);
$message = nl2br($message); //keep carriage returns
return $message;

Open in new window

Question by:axtur
  • 2
  • 2
LVL 19

Accepted Solution

darron_chapman earned 2000 total points
ID: 22972034
From what  I understand... the posix error is coming from this [:a-z:]{2,4} ... can you change that to [a-z]{2,4} ???

Author Comment

ID: 22972118

thank you for your answer, but how can this error show up now, since this code has been working for over a year so far?

I can't understand :(

anyway im gonna apply the suggested change and let you know if it works out.

thanks again!

Author Comment

ID: 22972170
It worked, probably somme inner software update in the server??

thank you!
LVL 19

Expert Comment

ID: 22972357
I'm guessing it was an update that caused the code to stop working... perhaps a POSIX extension was installed and/or enabled... not sure... i'm glad that it's working now.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question