@strings = ("notalot", "england,rugby" , "chicken,egg,duck,feet" , ",southampton" , "bristol," , "iran, canada,france" , "" , ); for (@strings) { print "$_\n" if /^[a-zA-Z]([a-zA-Z]+|,(?!,|$))*$/; }