2008/9/19 Fritzek <fritz.thielemann / googlemail.com>:
> thanks for your objection, but could you shortly explain the
> difference (for regexp dummies like me)?

Ideally you read "Mastering Regular Expressions" which explains such
topics very nicely.

I believe it is generally better to be more specific about what is to
match (mainly for robustness reasons).  Also, with the reluctant
quantifier for every character in the input a match against the next
sub pattern needs to be tested OR there needs to be backtracking to
find out whether there is a shorter match afterwards.  Both seem not
very efficient.  Granted, this is no hard evidence, but if you are
curious I suggest you do some benchmarks and read the book; it's
really good!

Kind regards

robert

-- 
use.inject do |as, often| as.you_can - without end