From: Ron Jeffries Date: 2002-02-13T20:54:13+09:00 Subject: simple XML parsing (greedy / non-greedy Suppose I had this text 'this is athis is a also' and I wanted to write a regexp that would match the tag .. and return 'this is a' (not 'this is athis is a also') I'd sort of like to use a pattern like Regexp.new( '(.*)' ), but this is greedy and matches as far as it can. Is there a way to tell the match operator to stop on the earliest match? If not, what's a good way to get what I want ... I /do/ want to accept embedded tags such as this is ok the answerand this is not so I can't just blow out on a '<'. (I do know I could go to a real XML parser, and maybe I will. Right now I'm just looking to extract some moderately simple stuff ... Thanks ... Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you.