eregi

PHP 5 : Function eregi()

Hi, I m using PHP5 with Xampp server After successful installation of OSCommerce2.2 there are some warnings appear as below Deprecated: Function eregi() is deprecated in D:\xampp\htdocs\oscomm\catalog\includes\classes\language.php How ever this was never occur before .. ...

PHP regular expression match gives error

Trying to check the string for pattern. $variable = '[text]'; if (eregi("/(\[(.*?)\])/", $variable)) {} This code gives error eregi() [function.eregi]: REG_BADRPT What is the solution for this? ...

How change de eregi to preg_match in this code?

if (preg_match('^'.preg_quote($this->config_document_root), $filename)) { $AbsoluteFilename = $filename; $this->DebugMessage('ResolveFilenameToAbsolute() NOT prepending $this->config_document_root ('.$this->config_document_root.') to $filename ('.$filename.') resulting in ($AbsoluteFilename = "'.$AbsoluteFilename.'")', __FILE...

My PHP preg_match expression isn't working.

I tried to directly convert an "eregi" expression to a "preg_match" expression. $ACCEPT_CHARS = "a-z0-9_~#&;=./?+-"; $msg = preg_match("/ (http|https|ftp|gopher|news)://([$ACCEPT_CHARS]+)/i", "<a href=\"\\1://\\2\" target=\"_blank\">\\1://\\2</a>", $msg); However, I get: Warning: preg_match() [function.preg-match]: Unknown modifier '...

PHP - eregi regular expression error

This is the code I am working on if(trim($_POST['phone']) == '') { $hasError = true; print "phone number empty"; } else if (!eregi("^\(?[\d]{3}\)?[\s-]?[\d]{3}[\s-]?[\d]{4}\s*$", trim($_POST['phone']))) { // if I am right this should validate all U.S. numbers $hasError = true; print "phone number does not ...