0

我有一些示例字符串,例如:

There is one wherever you one and here is the one , nowhere is the one .

我想在第二个one和第三个之间提取one,即and here is the

我不知道如何相应地定位我的模式..有人可以帮忙吗?

4

1 回答 1

1

\K被低估了

grep -oP '^(.*?one){2}\K.*?(?=one)' \
     <<< "There is one wherever you one and here is the one , nowhere is the one"
and here is the 
于 2013-08-31T03:20:37.613 回答