gpt4 book ai didi

regex - 在多行中第一次出现时结束正则表达式模式

转载 作者:行者123 更新时间:2023-12-02 17:19:46 25 4
gpt4 key购买 nike

<分区>

你好有这个字符串

  <20170503-18:19:09, FIXT.1.1:BANZAI->EXEC, event> (Initiated logon request)
<20170503-18:19:09, FIX.4.4:BANZAI->EXEC, incoming> (8=FIX.4.4☺9=67☺35=A☺
34=177☺49=EXEC☺52=20170503-18:19:09.298☺56=BANZAI☺98=0☺108=30☺10=092☺)
<20170503-18:19:09, FIX.4.4:BANZAI->EXEC, event>
(Received logon) fdsfhffghgfhgjgf 177☺49=EXEC☺52=20170503-18:19:09.298☺
56=BANZAI☺98 (Received logon) more stuff after this....

当我像这样编写我的正则表达式模式以适应多行和中间的任何字符时,我想查找在关键字“启动的登录请求”之后是否有以下响应“已收到登录”

 Initiated logon request.*[\S\s]*Received logon 

我得到字符串中最后一个关键字的所有内容结果

  Initiated logon request)
<20170503-18:19:09, FIX.4.4:BANZAI->EXEC, incoming> (8=FIX.4.4☺9=67☺35=A☺
34=177☺49=EXEC☺52=20170503-18:19:09.298☺56=BANZAI☺98=0☺108=30☺10=092☺)
<20170503-18:19:09, FIX.4.4:BANZAI->EXEC, event>
(Received logon) fdsfhffghgfhgjgf 177☺49=EXEC☺52=20170503-18:19:09.298☺
56=BANZAI☺98 (Received logon

我想做的是在找到第一个关键字时停止正则表达式,

  Initiated logon request)
<20170503-18:19:09, FIX.4.4:BANZAI->EXEC, incoming> (8=FIX.4.4☺9=67☺35=A☺
34=177☺49=EXEC☺52=20170503-18:19:09.298☺56=BANZAI☺98=0☺108=30☺10=092☺)
<20170503-18:19:09, FIX.4.4:BANZAI->EXEC, event>
(Received logon

有没有办法做到这一点谢谢你的帮助。

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