我有这个图案
Calibration attempts: 0
Successful calibrations: 0
Calibration attempts: 0
Successful calibrations: 0
我需要一个正则表达式,它会和这个完全一样。这根本不应该匹配:
Calibration attempts: 1
Successful calibrations: 0
Calibration attempts: 0
Successful calibrations: 0
到目前为止,我只想到了这个,但它看起来很糟糕
(.*Calibration attempts: 0\n.*Successful calibrations: 0\n.*Calibration attempts: 0\n.*Successful calibrations: 0.*)
这应该有效:
(^[\t ]+(Calibration|Successful| |attempts|calibrations)+: 0$\n?){4}
查看regex101.com,您可以在那里进行测试。 我测试了此案例是否不匹配任何不是“0”的内容
干杯
相关问题 更多 >
编程相关推荐