📜  grep 捕获组 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:29.733000             🧑  作者: Mango

代码示例1
# matches and returns b
$ echo "abc" | grep -oP "a\K(b)(?=c)" 
b 
# no match
$ echo "abc" | grep -oP "z\K(b)(?=c)"
# no match
$ echo "abc" | grep -oP "a\K(b)(?=d)"