Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jan 2014 21:49:31 -0600
From:      Paul Schmehl <pschmehl_lists@tx.rr.com>
To:        Warren Block <wblock@wonkity.com>, 'Devin Teske' <dteske@FreeBSD.org>
Cc:        'RW' <rwmaillists@googlemail.com>, freebsd-questions@freebsd.org
Subject:   RE: awk programming question
Message-ID:  <834811727E040B4079BD1CB4@Pauls-MacBook-Pro.local>
In-Reply-To: <alpine.BSF.2.00.1401241029230.89161@wonkity.com>
References:  <F01EB9CE742DEB17DB6B51C7@localhost> <alpine.BSF.2.00.1401230900270.76961@wonkity.com> <20140123185604.4cbd7611@gumby.homeunix.com> <04a201cf1878$8ebce540$ac36afc0$@FreeBSD.org> <alpine.BSF.2.00.1401231346520.80613@wonkity.com> <04aa01cf187e$cfcf9ef0$6f6edcd0$@FreeBSD.org> <alpine.BSF.2.00.1401231537260.80613@wonkity.com> <04d201cf1895$20956890$61c039b0$@FreeBSD.org> <alpine.BSF.2.00.1401231904410.82598@wonkity.com> <050a01cf1929$051c0670$0f541350$@FreeBSD.org> <alpine.BSF.2.00.1401241029230.89161@wonkity.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
--On January 24, 2014 10:34:47 AM -0700 Warren Block <wblock@wonkity.com> 
wrote:

> On Fri, 24 Jan 2014, dteske@FreeBSD.org wrote:
>
>>>> 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 really make it much more powerful.  perlre(1) covers it all,
>>> sketchily and not really in order.
>>>
>>> I've said elsewhere, and will repeat again: "Mastering Regular
>>> Expressions" 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:
>>>
>>> http://shop.oreilly.com/product/9780596528126.do
>>
>> 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 with a quote and has a matching terminating quote, but not
>> match a string that has a quote without matching termination).
>
> It does cover backreferences, in the sense of egrep:
> \<[A-Za-z]+) +\1\>
>
> That will find a word followed by one or more spaces and the same word
> again.
>
>> If-so, I'm totally buying that book.
>
> Buy it.  I've never seen another book that treats such a complex subject
> with such clarity and readability.

I can't possibly thank you gentlemen enough for this wonderful discussion 
of awk and perl and regex.  Thank you for sharing your insights and 
knowledge.

Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
*******************************************
"It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead." Thomas Jefferson
"There are some ideas so wrong that only a very
intelligent person could believe in them." George Orwell




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?834811727E040B4079BD1CB4>