while(<>) { print "yes\n" if /^y$/i || /^yes$/i; }
while(<>) { print "yes\n" if /^y$/i; print "yes\n" if /^yes$/i; }
By the way, useless capturing greatly slows down pattern matching.
In reply to Re^3: conditional regex
by ikegami
in thread conditional regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |