PHP error, preg_replace?

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('^([._a-z0-9-]+[._a-z0-9-]*)(@|AT)(([a-z0-9-]+\.)*([a-z0-9-]+)((\.|DOT)[a-z]{2,3}))$',"#",$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

axturAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

darron_chapmanCommented:
From what  I understand... the posix error is coming from this [:a-z:]{2,4} ... can you change that to [a-z]{2,4} ???
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
axturAuthor Commented:
darron:

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!
0
axturAuthor Commented:
It worked, probably somme inner software update in the server??

thank you!
0
darron_chapmanCommented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.