From: Todd Benson Date: 2008-02-15T02:55:42+09:00 Subject: Re: Problem usning 'OR' operator in 'IF' condition? On Thu, Feb 14, 2008 at 1:01 AM, dare ruby wrote: > Dear friends, > > I have got an error when i tried to check multiple condition using "OR" > operator inside "IF" loop. > > my code is > > if @character != 'R' || @character != 'r' > > raise " Expected 'R' after 'E' in version Declaration" > The statement " If character is not 'R' _OR_ character is not 'r' " will always be true. If it is "R", then it is not "r", and vice versa. In the other one that you said works (with the == instead of the !=) contradicts a little with your original code. Do you want to raise when there exists an [rR] or when there does not exist an [rR]? Look at Robert's code. I like the one with the regular expression. Todd