Expand email reg exp to allow only ; delimiter

Posted on 2004-11-23
Last Modified: 2010-04-17
I use the Regular Expression
resourced from which works great.

I want to adapt  this to vlidate a sctring of emailaddress delinited by ;. So it would pass
 but not,

So an optional [;] but how I can I ensure no other delimiters?

Thanks, Tom.
Question by:tomcorcoran
    LVL 1

    Accepted Solution


    - The most important part is: (?:$|\;) . I just make sure that each e-mail address ends with EOL or ';' delimeter.
    - \w is the word character: [a-zA-Z_0-9]
    - \d is the digit character: [0-9]
    - I use (?:X) as a non-capturing group. Remove all "?:" strings to get more readable (but also slower and more memory-consuming) version.

    Author Comment

    Thanks for the post. Unfortunately the regex falvour I use (TRegExpr for Delphi - gives the error : TRegExpr(comp): Unrecognized Modifer (pos 33) I'm not sure if it's the interval quantifier which it does not support.
    I contacted the author a week ago but he has not there an alternative this might support?

    Cheers, Tom.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Suggested Solutions

    Title # Comments Views Activity
    twoTwo  challenge 35 71
    Problem to setup 18 64
    count8 challlenge 13 65
    Sorting in Excel with Group Headers if the Exist 2 47
    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
    Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now