Tôi có một tệp nhật ký với các mục như sau:
Đầu vào
php notice bob
php notice winner
php notice blah winner
php notice asfsdf test
php erro)r bob
php error winner
php error trash winner
php error junk test
print this line
Đầu ra
php notice winner
php notice blah winner
php error winner
php error trash winner
print this line
Những gì tôi đang cố gắng làm là khớp tất cả các dòng từ một tệp nhật ký trừ khi - nó chứa phptheo sau bởi errorhoặc notice. Nếu nó chứa phptheo sau bởi errorhoặc notice, thì nó chỉ nên khớp nếu winnercũng nằm trong chuỗi. Regex-foo của tôi yếu. Cảm ơn.