Possible Duplicate:
Warning: preg_match() [function.preg-match]: Unknown modifier '/'警告:的preg_match()[function.preg匹配]:未知的修飾詞 '{' 我
我有這個代碼至極的煩惱給了我一個錯誤:
Warning: preg_match() [function.preg-match]: Unknown modifier '{' in /usr/home/anubis-cosmetics.com/web/includes/functions/functions_email.php on line 568
Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in /usr/home/anubis-cosmetics.com/web/includes/functions/functions_email.php on line 586
線568 :
if email domain part is an IP address, check each part for a value under 256
if (!preg_match ($valid_ip_form, $domain)) {
$digit = explode(".", $domain);
for($i=0; $i<4; $i++) {
if ($digit[$i] > 255) {
$valid_address = false;
return $valid_address;
exit;
}
行586:
if (!preg_match($space_check, $email)) { // trap for spaces in
if (!preg_match ($valid_email_pattern, $email)) { // validate against valid email patterns
$valid_address = true;
} else {
$valid_address = false;
return $valid_address;
exit;
}
}
return $valid_address;
}
?>
我不知道該怎麼做,有人可以幫助我嗎?
編輯/////
我試圖改變分隔符這樣的:#--->
// if email domain part is an IP address, check each part for a value under 256
if (!preg_match ($valid_ip_form, $domain))#
$digit = explode(".", $domain);
而另一個用於此:
if (!preg_match($space_check, $email)) { // trap for spaces in
if (!preg_match ($valid_email_pattern, $email)) { // validate against valid email patterns
$valid_address = true;
} else {
$valid_address = false;
return $valid_address;
exit;
}
}
return $valid_address;#
仍然沒有工作......有人可以更具針對性(向我展示一些內聯示例)關於該問題?謝謝!
包括你的正則表達式爲好,他們似乎是無效 – Laimoncijus
什麼是'$ valid_ip_form'的價值?聽起來像你沒有提供分隔符。 –
供參考:http://php.net/manual/en/regexp.reference.delimiters.php –