From: Paul Lutus Date: 2006-11-25T17:10:05+09:00 Subject: Re: regexp working with mixed lines endings Une b辿vue wrote: / ... > is their a special option able to work with all kind of endings ? Sure. For mixed Windows and Unix/Linux line endings, just delete the carriage returns: data.gsub!{/\r/,"") > > my regexps : > > rgxstart=Regexp.new("") > rgxstop=Regexp.new("") > > > the comparaison i do : > > rgxstart === l.chomp > > l being : > > File.open().each { |l| ...} Try this instead: data = File.read(filename) data.gsub!(/\r/,"") array = [] data.split("\n").each do |line| # process lines here array << line end By using this approach, all your XML lines will be made uniform. At the end of the processing, you will need to reintegrate the lines into a block for storage: data = array.join("\n") file.open(filename,"w") { |f| f.write data } -- Paul Lutus http://www.arachnoid.com