0

Possible Duplicate:
Warning: preg_match() [function.preg-match]: Unknown modifier '/'

I am having troubles with this code wich gives me the next error:

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

Line 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;
        }

Line 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;
  }


?>

I don't know how to do it, can someone help me with this?

EDIT/////

I've tried to change the delimiters for this: # --->

// 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 );

And the other one for this:

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;#

And still without work... Can someone be more especific (showing me some example inline) about the problem? Thanks!

4

1 に答える 1

2

問題は$valid_ip_formそれぞれにあります$space_check。それらは無効な php PCRE 式になります。

開始区切り記号と終了区切り記号が欠落しており、式が次のようになっていると思います。

^[0-9]{3}$

それ以外の:

~^[0-9]{3}$~
/^[0-9]{3}$/
#^[0-9]{3}$#

またはあなたが好きなもの。

詳細情報が必要な場合は投稿してください

于 2012-10-09T07:19:34.303 に答える