我试着用这个regex .*[%].*(?:.*|(?:\n.+)*)来获取块。
我想得到包含%运算符的行,如下所示:
Match 1:
Test14%=SN54LS161AJ=U14,
Match 2:
U15%=123131CCC11=U15, LOGIC , ---, 40394
[Unit] =
[Diag] = Tests ERROR
Match 3:
P10%=SN54LS161AJ=U14, LOGIC , ---, 40734
Match 4:
X10%=123C11=U15, LO
[Unit] =
[Diag] = Tests ERROR 70
Match 5:
N20%=SN54LS161AJ=U14, LO
Match 6:
N20%=123C11=N20
[Unit] =
[Diag] = Tests ERROR 2我在这里尝试一个例子:https://regex101.com/r/BPLJlJ/1
https://stackoverflow.com/questions/66136937
复制相似问题