请教,我不理解为什么^..*,[1-9]*,\+在如下grep , sed的结果是match的?
$ echo '11162,1,2020-02-17 19:59:31:696,+000000000 00:01:39.097' | grep '^..*,[1-9]*,\+'
11162,1,2020-02-17 19:59:31:696,+000000000 00:01:39.097
$ echo '11162,1,2020-02-17 19:59:31:696,+000000000 00:01:39.097' | sed 's/^..*,[1-9]*,\+/REPLACED/g'
REPLACED2020-02-17 19:59:31:696,+000000000 00:01:39.097
因为有后面的\+我觉得结果应该是不match的才是,感觉grep及sed像是忽略了\+的部份...
就像缩图如下,在https://regex101.com/的测试结果是不match的.
https: //ppt.cc/ft48Jx
PS:不知为什么一直被判定内容有广告,所以我将缩图的:后面加了空白,有劳将空白拿掉就可显示缩图.
环境:
Linux 2.6.32-642.el6.x86_64 #1 SMP Wed Apr 13 00:51:26 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
grep (GNU grep) 2.20