From: Gavin Kistner Date: 2005-09-05T16:13:56+09:00 Subject: Re: Making my Regex less greedy? On Sep 4, 2005, at 10:11 PM, luke wrote: > So, {100,#{m.length}}? effectively is now finding the first match, > if any > .... Out of curiosity, is it easy to express "find the 3rd match"?. > (Rather > than saying "find 3 matches"). a) As noted in my example, you can leave the second 'argument' to the range quantifier empty, in which case it is unbounded. a{3,5} <== find 3-5 'a' chars a{3,} <== find at least 3 'a' chars, up to ... well, as many as you can b) String#scan will take a regexp and return an array of all matches in the document. (Not as useful if you need the saved sub- expressions, however.)