bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] maint: change "can not" to "cannot"


From: Jim Meyering
Subject: Re: [PATCH] maint: change "can not" to "cannot"
Date: Sun, 10 Apr 2011 10:10:47 +0200

Jim Meyering wrote:
> Here's perl-based gorp that's uncovered a few more.
> The tricky part was to get the line numbers while in perl's
> slurp-entire-file mode (-0777).
>
> git ls-files|xargs perl -0777 -n \
>   -e 'while (/\b(a|then?|if|but|or|and|to)\s+\1\b/gms)' \
>   -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/; print "$ARGV:$n:$v\n"}'

For slightly better coverage (and more false positives)
add "i" to the regexp options:

  git ls-files|xargs perl -0777 -n \
    -e 'while (/\b(a|then?|if|but|or|and|to)\s+\1\b/gims)' \
    -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/; print "$ARGV:$n:$v\n"}'



reply via email to

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