Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jan 2014 09:23:36 -0800
From:      <>
To:        "'Warren Block'" <>, "'Devin Teske'" <>
Cc:        'RW' <>,
Subject:   RE: awk programming question
Message-ID:  <050a01cf1929$051c0670$0f541350$>
In-Reply-To: <>
References:  <F01EB9CE742DEB17DB6B51C7@localhost> <> <> <04a201cf1878$8ebce540$ac36afc0$> <> <04aa01cf187e$cfcf9ef0$6f6edcd0$> <> <04d201cf1895$20956890$61c039b0$> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help

> -----Original Message-----
> From: Warren Block []
> Sent: Thursday, January 23, 2014 6:23 PM
> To: 'Devin Teske'
> Cc: 'RW';
> Subject: RE: awk programming question
> On Thu, 23 Jan 2014, wrote:
> >> No, the non-greedy modifier to a standard quantifier:
> >>
> >> echo "abczabczabcz" | perl -ne '/(a.*z)/; print "$1\n"'
> >> abczabczabcz
> >>
> >> echo "abczabczabcz" | perl -ne '/(a.*?z)/; print "$1\n"'
> >> abcz
> >
> > Craziness! Wonder when that crept in.
> I've been using it for at least a decade, so it's probably been around at
> twice that long.  ...So probably came out about twenty years after the sed
> and awk feature sets were frozen. :)
> > I'm not entirely sure how I feel about that -- in terms of
> > readability, I'm not sure if the following is more readable:
> >
> > 	/(a[^z]*z)/
> Wait till you see the other PCRE stuff.  There are lots of things that
> make it much more powerful.  perlre(1) covers it all, sketchily and not
> in order.
> I've said elsewhere, and will repeat again: "Mastering Regular
> by Jeffrey E. F. Friedl (the owl book) is amazing.  My first edition
(1997) does
> not have some of the newer Perl stuff, but it's now up to a third edition:

Does it cover "back references" ? Definitely one of the more powerful but
esoteric regular expressions (e.g., you want to match a string that starts
a quote and has a matching terminating quote, but not match a string that
a quote without matching termination).

If-so, I'm totally buying that book.

The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.

Want to link to this message? Use this URL: <$051c0670$0f541350$>