Jump to content

bikeria

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bikeria's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I didn't understand what do you mean with pattern. This is my code: function tep_validate_email($email) { $valid_address = true; $mail_pat = '^(.+)@(.+)$'; $valid_chars = "[^] \(\)<>@,;:\.\\\"\[]"; $atom = "$valid_chars+"; $quoted_user='(\"[^\"]*\")'; $word = "($atom|$quoted_user)"; $user_pat = "^$word(\.$word)*$"; $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$'; $domain_pat = "^$atom(\.$atom)*$"; //if (eregi($mail_pat, $email, $components)) { if (preg_match($mail_pat, $email, $components)) { $user = $components[1]; $domain = $components[2]; // validate user //if (eregi($user_pat, $user)) { if (preg_match($user_pat, $user)) {
  2. Hello, i'm a php newbie and i didn't understood how to use the preg_match correctly. I tried to initiate a ecommerce tool and got a PHP 5.3 environment. I must migrate the ereg-family command to the preg_match statement. So I changed the code to: if (preg_match($mail_pat, $email, $components)) { and i got the error: preg_match() [function.preg-match]: No ending delimiter '^' found in so what must i do? Thanks a lot.
×
×
  • 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.