From: Diego Suarez Date: 2007-09-07T08:10:59+09:00 Subject: Re: Reg Ex ------=_Part_52817_26880413.1189120258234 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi I don't know if you need to check the caps, but your regex could be /cisco/i (the i is for case insensitive) To "ban" certain words, you' could use lookaround expression -and I don't know if Ruby supports it-, but I personally find cleaner check programatically against a list, and add the "exceptions" to that list. Hope it helps :-) Diego. On 9/7/07, Charles Pareto wrote: > > I'm querying through the .com's looking for any www name with Cisco in > it. > I'm using a reg exp that is reading a file line by line obtained by > Verisign that has all the domain names with a .com extension. > Here is my reg exp: > > file.each { |line| print line if line =~ /(C|c)isco|CISCO/ } > > but I'm getting results like SanFrancisco and Francisco. > > Does anyone know how I can modify my reg exp to not include certain > keywords like SanFrancisco and Francisco? > > > -Chuck > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_52817_26880413.1189120258234--