I just answered this is the other regexp thread.  If you put a ?you're regexp becomes non-greedy
LINK=/\(\(<(.+?)>\)\)/

On 4/1/06, Damphyr <damphyr / freemail.gr> wrote:> OK you Regexp gurus out there (has anyone noticed the relative size of> regexp threads -anything with regexp seems to excite lots of attention).>> I have a puzzler. I've been combing the ruby-talk archives trying to> convert the BlogRD format to Textile.> BlogRD marks links with ((< >)) and I thought it would be simple to use> the pattern /\(\(<(.+)>\)\) to get the links.>> Problem:>> Having two links in the same block of text completely screws up the results:>> TXT="((< Link one >)) and a bit further down ((< Link two >))"> LINK=/\(\(<(.+)>\)\)/>> TXT=~LINK> p $1> ---> " Link one >)) and a bit further down ((< Link two ">> I was expecting " Link one "> Why the result? Where id I go wrong?> V.-> P.S.> Take your time,I solved the parsing problem another way.> --> http://www.braveworld.net/riva>> ____________________________________________________________________> http://www.freemail.gr - δωρεάν υπηρεσία ηλεκτρονικού ταχυδρομείου.> http://www.freemail.gr - free email service for the Greek-speaking.>>