in reply to Re: prompting a user for input
in thread prompting a user for input

You probably want to anchor that at the ends, otherwise 'abcNOdef' and 'blahYblah' will match. Also, the parens around the single char 'o' are unnecessary.
/^(Y(es)?|No?)$/i

-Blake

Replies are listed 'Best First'.
Re: prompting a user for input
by s0ttle (Scribe) on Nov 11, 2001 at 20:21 UTC
    Looking at:
    ~/^(y|yes)$/i
    This would be my choice:
    ~/^(?:y(?:|es))$/i;
    matches y or yes without any regard to case and doesn't store the match in $1 unnecessarily. TMTOWTDI

    -tengo mas que aprender