Jump to content

Warning: preg_replace() [function.preg-replace]: No ending delimiter '^' found


DameonMason

Recommended Posts

Im new to PHP 5 and have not coded in about 3 years so now im trying to make a gallery script for for a friend that still have the eregi functions in them. So far so good but the one little error that keeps coming up is the No ending delimiter. My code is as follows

 

if ($this->iswindows) {

$AbsoluteFilename = preg_replace('^'.preg_quote(realpath($this->config_document_root)), realpath($this->config_document_root), $AbsoluteFilename);

$AbsoluteFilename = str_replace($this->osslash, '/', $AbsoluteFilename);

}

 

Obviously i have replaced eregi with preg_replace but now i keep getting the same error. I have tried the blogs and tried their advice but still no luck. Any advice would be much appreciated.

 

It's part of the preg/PCRE syntax for regular expressions, there are delimiters either side of a regex, you can choose pretty much anything so say

~regex-here~

or

#regex-here#

 

are both acceptable. You can also add modifiers after the second delimiter, such as "i" to make it case insensitive

Take a look here for more information

http://www.php.net/manual/en/pcre.pattern.php

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.