I'm scratching my head on the following oversimplistic grep command:
grep "GMT \+[0-9]{2}:[0-9]{2}" gmt_funny.txt
where gmt_funny.txt
contains:
2012-09-01 00:00:16.825 (GMT +02:00)
I've just discovered that the grep command doesn't match the line, unless I specify -E
as follows:
grep -E "GMT \+[0-9]{2}:[0-9]{2}" gmt_funny.txt
Does this means grep doesn't handle extended regular expressions ? The man grep seems to indicate that {
and }
is not supported, shall be replaced by \{
and \}
. Is this correct?
If yes, is there an explanation to this misleading particular behaviour of grep?