From: "Marcin Mielżyński" Date: 2008-01-08T02:49:59+09:00 Subject: Re: rexular expression quantifiers Robert Klemme pisze: > 2008/1/7, Johnathan Smith : >> just a quick question >> >> what is the difference between greedy and non greedy quantifiers? > > The greediness. > > Seriously: why don't you just try it out in IRB? > > s=("a"*10 + "b") > s+=s > s.scan /\w+b/ > s.scan /\w+?b/ > There's also possessive one (doesn't backtrack) ruby 1.9 or jruby 1.1 (trunk) irb(main):011:0> "aa" =~ /a++a/ => nil lopex