From: John Sikora Date: 2010-10-04T13:05:50+09:00 Subject: Re: save only first line from string? > > string.sub!(/^(.*\n?)((?im).+)?/, '\1').chomp > Oops, already found a problem. The chomp is not chomp! So it does not cut the "\n" off of the string (if present). You can;t just put the ! on the end of chomp because it returns nil if "\n" was not found. js -- Posted via http://www.ruby-forum.com/.