Im trying to match either the word "yes" or the word "no" in its
exact form... so far, no luck...
How in the world do I go about doing this? The current regex I have is allowing things like "yessir" and "nope" when I want to force it to only be either yes or no...
Here is the snippet:
while ( ($addques{$key}{answer} eq "") || ($addques{$key}{answer} !~
+/$addques{$key}{format}/) )
{
print " Invalid answer/option - try again\n";
print "$addques{$key}{question}";
chomp($addques{$key}{answer} = <STDIN>);
}
Where the format is nothing more than "yes|no"
Thanks for any help that can be provided - yall rock =)