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

Re: Is this a bug in grep, or is it me...



Dale Scheetz <dwarf@polaris.net> writes:

> $ grep -w debhelper override.potato
> debhelper       optional        devel
> hello-debhelper optional        devel
> 
> In the man page, under the -w option, it says that, in order to match, the
> string must be either at the beginning of the line, or preceeded by a
> non-word contituent character, which it declares as letters, digits, and
> the underscore.

No, it says that those are word constituent characters.

> The hyphon at the ned of hello in "hello-debhelper" isn't any of these,
> but grep declares it to match anyway! Is this something to do with the
> form of my expression?

It's preceded by a character that isn't a letter, digit or underscore:
a hyphen.


Reply to: