why output consists of 3 values

Hi there if I have a file called an411
which contains the folowing information
152.78.74.111 [13/Feb/2011:06:52:00 +0000] "GET /datafeed.php HTTP/1.1" 200 2826
152.78.74.211 [13/Feb/2011:06:53:00 +0000] "GET /index.html HTTP/1.1" 200 1190
152.78.74.121 [13/Feb/2011:06:55:00 +0000] "GET / HTTP/1.1" 200 3000
and I want to ouput the number of bytes of the record that contains pattern.
The code:

 grep '[datafeed.php]' an411 | cut -d" " -f8

returns
2826
1190
3000
Can anyone explain me why it returns 3 values. I think it should return only one because grep matches pattern doesn't it?
Any help :slight_smile:
Thanks in advance :slight_smile:

[] is a range of characters to match.

You are telling it to match any line which contains the characters d, a, t, a, f, e, e, d, ., p, h, p.

So, any line which contains p will match.

Any line which contains e will also match.

Any line which contains . will also match.

Any line which contains d will also match.

And so forth.

Leave off the [], and escape the . with \, to match the name 'datafeed.php'.

Thanks a lot!!! :wink: