bug-grep
[Top][All Lists]
Advanced

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

Should there be a difference in [G-H] and [GH] regular expressions?


From: Michal Pomorski
Subject: Should there be a difference in [G-H] and [GH] regular expressions?
Date: Fri, 5 Nov 2010 22:30:43 +0100

Using GNU grep 2.6.3 in fedora 11.

$echo patH/To/header.h | grep   -E '.*/[G-H].*\.h'
patH/To/header.h
$
Apparently it matches an empty string, because adding the -o option
produces no output.

$echo patH/To/header.h | grep   -E '.*/[GH].*\.h'
$
There is no output here.

Originally I wanted to find all files with capital letters in their
names, for which I used something like:
$find . | grep   -E '.*/[^/]*[A-Z][^/]*\.h'
but it kept printing some files without capitals.

Regards,
Michal



reply via email to

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