匹配并提取文件中两个单词之间的所有内容 [英] Match and Extract everything between 2 words in a file

查看:48
本文介绍了匹配并提取文件中两个单词之间的所有内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一段时间后提出了类似的主题,但我想从输入文件中获得一些额外的信息。

日志文件如图所示...

I had posed a similar topic some time back but I want some additional information from the input file.
The log file is as shown...

展开 | 选择 | Wrap | 行号

推荐答案

不清楚是否是整个日志文件,或者如果还有更多,则需要继续匹配更多记录。如果这是整个日志文件,那么你真正需要做的就是使用last和last。控制打破循环:

its not clear if that is the entire log file or if there is more and you need to continue matching more records. If that is the entire log file then all you really need to do is use the "last" control to break the loop:

展开 | 选择 | Wrap | 行号


这不是整个日志文件。还有更多的记录,比如我展示的需要匹配的记录。这只是我想要打印整个堆栈而不仅仅是那一行。
That''s not the entire log file. There are many more records like the one I showed that need to be matched. It''s just that I want the entire stack to be printed and not just that 1 line.


我只是略读帖子我可能会弄错但似乎你在使用非-greedy匹配。你想要一个贪婪的比赛。
I was just skimming the post I may be mistaken but it seems you are using a non-greedy match. Were you want a greedy match.
展开 | 选择 | Wrap | 行号


这篇关于匹配并提取文件中两个单词之间的所有内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆