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

Re: aspell upgrade woes

[Steve Langasek]
> The best heuristic I can come up with so far is
> dpkg -x $package tmpdir && \
> grep -rE '\b(use|class|template)\b|::|#include[[:space:]]+<[a-zA-Z_/]+>' tmpdir/usr/include
> That may turn up false positives due to the use of common English words, but
> I can't think of a way it could turn up false negatives.

Here is one ;)
  $ export LC_ALL=et_EE.UTF-8
  $ echo '#include <vorlon>' | grep -E '\b(use|class|template)\b|::|#include[[:space:]]+<[a-zA-Z_/]+>'

When bracket expressions are used within regular expressions of commands
which are influenced by LC_COLLATE (like grep, sed, ...), LC_ALL must be
set to C before running this command.
An alternative way is to replace [a-zA-Z_/] by [[:alpha:]_/] though I am
not 100% sure whether it is mandated that any locale has all ASCII letters
in its alpha character class.

Reply to: