匹配并提取文件中两个单词之间的所有内容

编程入门 行业动态 更新时间:2024-10-24 21:32:22
本文介绍了匹配并提取文件中两个单词之间的所有内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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 | 行号

更多推荐

匹配并提取文件中两个单词之间的所有内容

本文发布于:2023-10-24 14:50:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524225.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:所有内容   单词   两个   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!