From: "Marcin Mielżyński" Date: 2006-02-13T05:38:25+09:00 Subject: Re: Cutting a piece of text David Vallner wrote: > The nongreedy match has to "back up" and retry on every character after the > tag name, whileas James' [^>] doesn't ever have to back up. In fact, even a > greedy .* would probably be faster than a nongreedy one in this case. > > Gotta love the black art that is optimizing regexps. > Ooops.. You are right! But as I read greedy quantifiers do backtrack as well (but not in the case above). /a+aa/ =~ "aaaaa" will backtrack two characters only possesive quantifier (in oniguruma e.g.) consumes in the real, greedy way. so /a++aa/ =~ "aaaaa" won't match. lopex