Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Content Filter Unusable With Multiline Text #70

Closed
zor-el opened this issue Mar 18, 2020 · 0 comments · Fixed by #71
Closed

File Content Filter Unusable With Multiline Text #70

zor-el opened this issue Mar 18, 2020 · 0 comments · Fixed by #71

Comments

@zor-el
Copy link
Contributor

zor-el commented Mar 18, 2020

Typical real-world use cases for a content filter involve multiple matches and regex captures spread over several lines of text. Alas, the current implementation only works if the entire filter expression is contained within a single line. 1,2

Tested with version 1.8.0 and HEAD.

I will be posting a PR that fixes this in a few minutes.

BTW, love this tool. :)


1) This is not so surprising. A look at the corresponding test revealed only the most trivial cases are covered. (The aside here being: Perhaps review the tests to cover more realistic scenarios. ;-))

2) Note that using more than one file content filter per rule is currently not an acceptable workaround, b/c the way the FileContent filter is implemented, it involves redundant textract processing and severe performance penalties when used multiple times per rule, particularly for formats other than plain text, ex. PDF. (This is worth rethinking in its own right, but not the subject of this issue.)

zor-el added a commit to the-geekery/organize that referenced this issue Mar 18, 2020
Side benefit: Much better run-time performance
compared to multiple filters per rule.

Closes tfeldmann#70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant