sed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: manual improvements: section+examples of D/N/H/P commands


From: Jim Meyering
Subject: Re: manual improvements: section+examples of D/N/H/P commands
Date: Wed, 28 Dec 2016 10:20:27 +0100

On Wed, Dec 28, 2016 at 5:46 AM, Assaf Gordon <address@hidden> wrote:
> Hello,
>
> Attached 3 small patches, each adds a section to the manual about D/N/H/P 
> commands.
>
> Comments and suggestions welcomed,
>  - assaf
>
> =====
> [PATCH 1/3] doc: add 'multiline techniques' section
> [PATCH 2/3] doc: new annotated example section for N/D commands
> [PATCH 3/3] doc: new annotaed example for N/P/D/b commands
> =====

Thank you!
I've begun to go through that and have attached some typo fixes that
you may fold in.

In looking at the doubled-word detection, e.g.,

+$ grep -E '(\b\w+\b)\s+\1' two-cities-dup1.txt
+it was the@ the age of wisdom

I have some suggestions.
  - put the grouping parentheses only around the \w+
  - the latter \b is redundant, since any transition from \w to \s is
a word boundary.

To precisely detect doubled words, one must be a little more careful,
to avoid a false positive like this:

  $ echo the then|grep -E '(\b\w+\b)\s+\1'
  the then

For the all-in-one-line case, '\b(\w+)\s+\1\b' may be adequate.

Attachment: sed-multiline-typos.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]