in reply to Yes No Validation

something like this?

if( /^[Yy](?:es)?$/ ) { # do what you do for "yes" } elsif( /^[Nn]o?$/ ) { # do what you do for "no" } else { # error }