How can I combine a positive and negative condition in a regex?
perl, regex, regex-lookarounds, regex-negation
Solution
/^(?!SKIPPING).*too long/
Problem
I fairly new to regular expressions and need some help. I need to filter some lines using regex in Perl. I am going to pass the regex to another function so it needs to be done in a single line. I want to select only lines that contain `"too long"`and that don't begin with `"SKIPPING"` Here are my test strings: SKIPPING this bond since maturity too long TKIPPING this bond since maturity too long SLAPPING this bond since maturity too long Hello this maturity too long this is too long hello there The regex rule should match the following on 'too long": SKIPPING this bond since maturity too long SLAPPING this bond since maturity too long Hello this maturity too long this is too long and it should skip: "hello there" because it doesn't contain 'too long' "SKIPPING this bond since maturity too long" because it containst 'SKIPPING'