Announcement

Collapse
No announcement yet.

E-mail Regex

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • E-mail Regex



    Hi I'm wondering if anyone has an EMAIL REGEX? I mean a good one that 'considers' all the possibilities like subdomains and IP addresses as well as the weird chars and whatnot. I can make my own simple one but it only works with simple addresses.

    So does anyone know of like a real good REGEX that is PROFFESIONAL and doesn't return false on any REAL emails?

    THANK YOU!

    EDIT: OH AND I would prefer it be in the perl syntax plz (but still phor PHP) Like with the "/REGEX HERE/" thingy thanks!

  • #2
    Try:

    /^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~][email protected]([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i

    (taken from register.php)
    Last edited by MUG; Mon 19th May '03, 1:03pm.

    Comment


    • #3
      try this one.


      /^[a-z0-9][^\(\)\<\>\@\,\;\:\\\"\[\]]*\@[a-z0-9][a-z0-9\-\.]*\.[a-z]{2,4}$/i

      it's long but works really well
      Jon Whitcraft
      Internal Systems Engineer - SugarCRM

      Comment


      • #4
        yayyyyyyyyyyy!

        Thanks guyz!

        Comment


        • #5
          You should note that reading those quickly... use the first half of the first regex and the second half of the second regex.
          London Fixed-gear and Single-speed

          Comment


          • #6
            Sorry I don't get ya!

            What do you mean? :-|

            BTW whats the diff between the two? Is one better than the other or just a different way of doing it?

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...
            X