我有这样的模式
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.*)发布于 2020-05-13 21:57:36
这应该是可行的:(^[\t ]+(Calibration|Successful| |attempts|calibrations)+: 0$\n?){4}
查看regex101.com,您可以在那里进行测试。我测试了这个案例,因为它不匹配任何不是“0”的内容
干杯。
https://stackoverflow.com/questions/61772012
复制相似问题