From: Paul Lutus Date: 2006-11-16T03:40:06+09:00 Subject: Re: Regexp with Ruby Ajay Vijey wrote: > Hallo @ all, > > I have to replace in a File the image tags with an other! As another poster has pointed out, you aren't showing enough code for an analysis, and, while you are replacing tags, please reformat your IMG tags thus: Note the self-closing form. This won't bother older browsers, and it will allow you to meet the newer (X)HTML standards as well. Here is sample program that extracts all the IMG tags from a Web page (of both the old and new varieties): ---------------------------------------- #!/usr/bin/ruby -w data = File.read("sample.html") extract = data.scan(%r{}m) puts extract.join("\n") ---------------------------------------- This outputs from my sample page: -- Paul Lutus http://www.arachnoid.com