I was wondering how to match a line without either of two words?
For example, I would like to match a line without neither Chapter
nor Part
. So neither of these two lines is a match:
("Chapter 2 The Economic Problem 31" "#74")
("Part 2 How Markets Work 51" "#94")
while this is a match
("Scatter Diagrams 21" "#64")
My python-style regex will be like (?<!(Chapter|Part)).*?\n
. I know it is not right and will appreciate your help.
Try this:
^(?!.*(Chapter|Part)).*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With