From: Paul Lutus Date: 2006-11-25T04:48:14+09:00 Subject: Re: Ruby with regular expression peppermonkey wrote: > >> What distinguishes the lines you _do_ want to change from the ones you >> _don't_ want to change? You don't say. Do all of them have ten digits? >> >> > How can you replace only those numbers in the above structure to >> > "xxxxxxxxxx"? >> > Openning a file, searching the file, writing to the file I'm presuming >> > is simple >> You're presuming? > > Sorry, should have made it clearer. > The lines that I do want changed has the exact structure of > > "This [] points to []" > > with exactly 10 digits inside the brackets. > There are no other lines with that structure. > There are however, other lines that have numbers enclosed by the square > brackets and they are to remain untouched. You really should show clearly how the target lines differ from the non-target lines. Your computer can't turn your prose description into working code. Neither can I. > Not at home right now so will have to wait till then to work on it. In that case, the solution I posted earlier will work with some small changes. But the changes depend on what you haven't said. -- Paul Lutus http://www.arachnoid.com