From: Fritzek Date: 2008-09-19T22:42:16+09:00 Subject: Re: short regexp question Hi Robert thanks for explanation and book hint. will search for it. Fritzek On 19 Sep., 15:23, Robert Klemme wrote: > 2008/9/19 Fritzek : > > > 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