gpt4 book ai didi

regex - Vi 编辑器模式匹配

转载 作者:太空宇宙 更新时间:2023-11-04 03:34:30 26 4
gpt4 key购买 nike

假设日志文件中的数据采用以下格式。

    *******************************************
Refreshing token for app foo1
*******************************************
Refreshing token for app foo2
*******************************************
Refreshing token for app foo3
Update application with name: foo3
Done
Waiting 1 second
*******************************************

此数据表明 foo1 和 foo2 的刷新 token 不完整,而 foo3 的刷新 token 完整。

我需要分离刷新 token 未完成的应用程序。

如何使用 vi 编辑器匹配 foo1 和 foo2。感谢任何帮助。

最佳答案

如果您使用 vim,并且打开文件:

<Esc>       To go to command mode
:1 <Enter> to go to line 1
/ Start a search
\d a digit
\n followed by a newline
\* followed by an escaped splat
<Enter> You will be positioned at the first match
n go to the next match

左下角看起来像这样:

/\d\n\*

当然,该数字与您的测试数据匹配,但您必须对其进行调整以匹配您的真实数据。

关于regex - Vi 编辑器模式匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32081765/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com