-
Notifications
You must be signed in to change notification settings - Fork 9
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
Change the filter API to avoid negative lookahead #188
Comments
While we're at it, we should reconsider the field names in the transformation config - let's try to make them as declarative as possible. |
Merged
I agree with your point here, I've personally lost a lot of time to figure out negative lookaheads so for a non-technical user it could be a nightmare. A configuration option sounds like the best solution to me and should be fairly easy to implement and document. |
colmsnowplow
added a commit
that referenced
this issue
Oct 12, 2022
colmsnowplow
added a commit
that referenced
this issue
Oct 12, 2022
Merged
colmsnowplow
added a commit
that referenced
this issue
Oct 14, 2022
colmsnowplow
added a commit
that referenced
this issue
Oct 14, 2022
colmsnowplow
added a commit
that referenced
this issue
Oct 24, 2022
Merged
colmsnowplow
added a commit
that referenced
this issue
Oct 25, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When we refactored the filter config for v1 release, we arrived upon the decision that using regex removes lots of complexity, since it does the work of handing matching logic for us.
Since the native go regex package doesn't support negative lookaheads, we decided to use regexp2, which does.
In hindsight, I can see now that this leads to two slightly problematic consequences:
The solution: We add a configuration option along the lines of
DiscardOnMatch
, which defaults to false. All it does isshouldKeepMessage = !shouldKeepMessage
. Then we just use the built inregexp
package, and we disallow negaitve lookaheads in configuration.I don't believe this leads to much additional complexity in the code, and it solves both of the above problems.
The text was updated successfully, but these errors were encountered: