From: Morton Goldberg Date: 2006-10-14T03:28:37+09:00 Subject: Re: Problem with a regular expression On Oct 13, 2006, at 1:55 PM, charles.nadeau@gmail.com wrote: > require 'net/http' > begin > hdoc = > Net::HTTP.get(URI.parse('http://finance.yahoo.com/lookup? > s=Dupont&t=S&m=US')) > > re = /(.*)/ > if hdoc =~ re > print "#{$&}\n" > else > print "Nothing\n" > end > end Whrn I substitute '\/TD' for '/TD' and make the regex case insensitive, I get a match. See below: ! /usr/bin/env ruby -w require 'net/http' hdoc = Net::HTTP.get(URI.parse('http://finance.yahoo.com/lookup? s=Dupont&t=S&m=US')) re = /(.*)<\/TD>/i ### note changes if hdoc =~ re puts "#{$&}\n" else puts "Nothing\n" end
Symbol Lookup
Name:Type:Market:
View supported exchanges
Regards, Morton
2 results for 'Dupont' (type=Stocks, market=U.S. & Canada)