Since Ruby does not have a negative look *behind* operator, I just used 
the negative look *ahead* in a backwards way, et viola!

>> puts a.reverse.gsub(/erit(?!.*wons)/, '>>>\&<<<').reverse
somebody who is a regular expression guru... how do you negate a word
and grep for all words that is

  <<<tire>>>

but not

  snow tire

or

  snowtire

so for example, it will grep for

  winter <<<tire>>>
  <<<tire>>>
  re<<<tire>>>
  <<<tire>>>d

but will not grep for

  snow tire
  snow   tire
  some snowtires

need to do it in one regular expression
=> nil
-- 
Posted via http://www.ruby-forum.com/.