in reply to Regular expression for combination of data

if $CD =~ /[CETLMNPA,]+/ { print "it matched\n"; }
You need to be more specific with what you're trying to do.

Replies are listed 'Best First'.
Re^2: Regular expression for combination of data
by isha (Sexton) on Jul 31, 2007 at 10:39 UTC
    This is not working. When $CD ="CM" (which is invalid) It says it matched. The letters must be seperated by comma (,)
    valid values are: "C,M" "C" "C,P"
    invalid values are : "CM", "PC" (each letter must be seperated by comma(,))