hyperscan icon indicating copy to clipboard operation
hyperscan copied to clipboard

Idea/Question: Logical combinations matching on single line

Open just-joshing opened this issue 4 years ago • 1 comments

Is there a way to scope logical combination matching to the same line?

I want to match a pattern but only if another pattern doesn't match on the same line. So I want a logical combination like (!A & B) where the expression is true if A and B are on separate lines or A doesn't appear at all, and false if A and B occur on the same line.

Thus far from my experimentation it seems logical combination just operates on the entire stream of content which means instead I have to write logic to capture the start lines of results for two patterns and compare them all to see how they line up.

Thanks!

just-joshing avatar Jul 16 '20 22:07 just-joshing

I don't think we can perfectly handle this kind of behavior at the moment, unless you scan each line separately. We may think about how to support this feature in the future.

fatchanghao avatar Jul 22 '20 05:07 fatchanghao