On Tue, Aug 26, 2003 at 10:03:18PM +1200, Nick Rout wrote:
> I am trying to use grep to match a sequence of characters followed by
> a tab character (hex 09, I have looked at the file in hex)

> so whats wrong with this?

> grep "nick\t" file ; or
> grep nick\t file ; or
> grep nick\x09 file ; or

These aren't supported by (GNU) grep's regular expression engine, even
in extended ('-e', or calling 'egrep') mode.

There are a couple of options you can try.  Firstly, if you must match
on a tab, insert a tab literal by hitting Ctrl-V, then Tab.

$ grep "nick    " file
            ^ Ctrl-V + Tab

If you can afford to be a little less strict about the regex's
definition, how about:

$ grep "nick\W" file

The "\W" will match non-word characters, including tab.

It may be that another tool, such as sed or Perl, may be better suited
to whatever you are trying to achieve.

Cheers,
-mjg
-- 
Matthew Gregan                     |/
                                  /|                [EMAIL PROTECTED]

Reply via email to