From: Robert Klemme Date: 2007-09-07T18:53:36+09:00 Subject: Re: Reg Ex 2007/9/7, Diego Suarez : > The boundaries could be a good idea, but if he needs urls like > ciscosystems.com, with the final \b won't match. Keep that in sight :) > > On 9/7/07, S P Arif Sahari Wibowo wrote: > > > > On Fri, 7 Sep 2007, Charles Pareto wrote: > > > file.each { |line| print line if line =~ /(C|c)isco|CISCO/ } > > ... > > > Does anyone know how I can modify my reg exp to not include > > > certain keywords like SanFrancisco and Francisco? > > > > How about: > > /\b([Cc]isco|CISCO)\b/ > > > > or even > > > > /\bcisco\b/i I'd probably use a second rx like file.each { |line| print line if line =~ /\bcisco/i && line !~ /sanfrancisco/i} Kind regards robert