in reply to Re: A tidier regex ?
in thread A tidier regex ?

It's for validation. These don't cater for the (underscores). These answers are opening up insight into Perl... I never realised it was so powerful.

Replies are listed 'Best First'.
Re^3: A tidier regex ?
by moritz (Cardinal) on Sep 14, 2010 at 14:43 UTC
    If you are validating, you should also anchor your regex to start and end of the string (and maybe allow leading and trailing whitespace).
    Perl 6 - links to (nearly) everything that is Perl 6.
Re^3: A tidier regex ?
by ikegami (Patriarch) on Sep 14, 2010 at 14:39 UTC
    \w does match underscore.
      It allows me to put CDC_ABC as a valid option, which I wish to reject. When I was looking for CDC_ABC_ABC for example.
        I specified the purpose of each of my solutions, and it wasn't validation in either case.