在Ubuntu 10.04上,bash版本为4.1.5(1),GNU grep版本为2.5.4。
这个命令可以匹配以下内容:
$ echo "this is a line" | grep 'a[[:space:]]\+line'
this is a line
但这并不表示
$ echo "this is a line" | grep 'a\s\+line'
但这也匹配
$ echo "this is a line" | grep 'a\s\+\bline'
this is a line
我不明白为什么#2没有匹配(但#1有匹配),而#3也有匹配。这里有什么区别?