davis,N brown,Y smith,Y,N,B jones,N,Y,B,A clarke,Y,N,Y #### if ($string =~ /^brown,Y/gi) {do this} else {do this}