請教,我不理解為什麼^..*,[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
--