From: Daniel Date: 2002-07-04T07:22:57+09:00 Subject: Re: Regular Expression problems For a good book on regular expressions, check out Jeffrey Friedells book on O'Reilley - Mastering Regular Expressions. You can find this answer, and many more there :) For Programming Ruby to cover all the regex things, it would take another book in itself. Daniel On Thu, 4 Jul 2002, Jonas Bengtsson wrote: > Hello Nobu, > > Wednesday, July 03, 2002, 8:56:22 PM, you wrote: > > > re = /\n(.*?)( > > Or: > > re = /\n(.*?)(?= > while match = re.match(unprocessed) > > name = match[1] > > content = match[2] > > unprocessed = match.post_match # <-- > > puts "MATCH", "name:#{name}", "content:#{content}" > > end > > Thanks! > I didn't see this in Programming Ruby before: > re ? > Matches zero or one occurrence of re. The *, +, and {m,n} modifiers > are greedy by default. Append a question mark to make them minimal. > > -- > Best regards, > Jonas > > Anyone can make the simple complicated. Creativity is making the complicated simple. > - Charles Mingus > -- A consultant is a person who borrows your watch, tells you what time it is, pockets the watch, and sends you a bill for it.