From: Paul Lutus Date: 2006-10-03T09:40:05+09:00 Subject: Re: regular expressions Tom Allison wrote: > I'm sorry if this has been done before, but I can't seem to find any good > examples: > > I'm trying to search mail messages for headers based on the following: > > config = YAML.load_file('config.yaml') > > $stdin.each do |line| > puts line if line =~ /^Recevied:/ .. line =~ /by > #{config['hostname']}/o > end > > and guess what? It doesn't work. Yes, it doesn't, and I think I know why. I have been hearing for years how it just doesn't matter whether young people learn how to spell common words, and I have steadfastly taken the position that it does matter. It turns out that people who can't spell, and who leave school confident that it is an out-of-date art, slowly discover all the odd places where knowing how to spell actually makes a difference. So, now that you are living in reality, perhaps you will discover one of the problems with your regular expression is that "Recevied" isn't a word, and it won't filter out those e-mails you want to collect. -- Paul Lutus http://www.arachnoid.com