Results 1 to 4 of 4
  1. #1

    Does this cover all email addresses?

    Does this cover all email addresses?


    When it comes to regex, I blow.

    Does this cover all email addresses?

    PHP Code:
    $config['permitted_chars_in_url'] = 'a-z 0-9~%.:_()@&\-!';


    Thanks


  2. #2

    Does this cover all email addresses?

    Nope. Emails can do lots of things nowadays. Especially with non-latin1 characters.

    The only regex that's "guaranteed" to work is
    Code:
    /^.*@.*\..*$/



  3. #3

    Does this cover all email addresses?

    Technically no.

    In reality, probably, though + should be included.

    Assuming this has to do with putting an email address in the URL, you really should be URL encoding the email addresses then you don't really have to worry too much about what strange characters someone might use in their email.



  4. #4

    Does this cover all email addresses?

    For most cases, you're better off using filter_var() rather then a regex.

    PHP Code:
    $check = filter_var ($email_to_check, FILTER_VAILIDATE_EMAIL);

    $valid = false;

    if (
    $check == $email_to_check) {
    $valid = true;
    }


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •