in reply to Exact pattern match?

If you are looking for 'yes' or 'no' I would suggest doing an 'eq'. If you need to get yes or no out of 'yes I can' or 'no I can't' then you may want to add some white space checking to your regex /(^|\s)(yes|no)(\s|$)/. The 'eq' will be faster.