hmmm \W was not suitable as the same characters followed by a space
were also in the file.
On Tue, 26 Aug 2003 23:02:10+1200 Matthew Gregan
<[EMAIL PROTECTED]> wrote:
> 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]
>
>