Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Question about regular expression (for email addresses)

Question about regular expression (for email addresses)

Scheduled Pinned Locked Moved Web Development
regexcomhelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vodstok
    wrote on last edited by
    #1

    I am working on a page with some email validation (classic asp) and I have a regex checking email addresses: ^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w][^_]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$ This worked perfectly, it allows multiple periods in the domain name, hyphens, etc. I have one issue though, I need it to allow for single-character domains (like 3.com). I am not very skilled in regex.

    ______________________ Oh Hamburgers!

    A 1 Reply Last reply
    0
    • V Vodstok

      I am working on a page with some email validation (classic asp) and I have a regex checking email addresses: ^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w][^_]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$ This worked perfectly, it allows multiple periods in the domain name, hyphens, etc. I have one issue though, I need it to allow for single-character domains (like 3.com). I am not very skilled in regex.

      ______________________ Oh Hamburgers!

      A Offline
      A Offline
      adkalavadia
      wrote on last edited by
      #2

      See this site http://regxlib.com/ here you can find as well as test your regular expression. :cool:

      !- F - R - I - E - N - D - S -!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups