From: "David A. Black" Date: 2004-09-23T04:36:17+09:00 Subject: Re: not greedy enough Hi -- On Thu, 23 Sep 2004, trans. (T. Onoma) wrote: > Right now I'm working on this: > > /^[ ]*[-](.*\n)+.*\n/ > > Applied to: > > %Q{ > - xyz > - abc > > - not this > } > > I want it to match just the first section, essentially > > " - xyz\n - abc\n\n". > > But it's matching the whole string. Can any of you Regexp experts fill me in? I think what you want is: match one or more consecutive occurrences of -\n, stopping when one of them has an extra \n at the end. Try this and see if it's close to what you need: /(^\ *-.*\n)+\n/ David -- David A. Black dblack@wobblini.net