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

core: add wildcard matching operators to eval (closes #608) #611

Closed
wants to merge 1 commit into from

Conversation

sim642
Copy link
Member

@sim642 sim642 commented Nov 30, 2015

This patch adds two operators, =* and !*, for matching/not matching strings by wildcard mask instead of more complicated regex. The =* operator was chosen instead of the suggested =% because the latter has lesser connection with wildcards, in my opinion.

Also this patch does not implement the "match against a list" behavior asked for because it does not make sense for one operator to be able to match against a list, while all the others match against a single string.

@@ -42,6 +42,8 @@ enum t_eval_comparison
{
EVAL_COMPARE_REGEX_MATCHING = 0,
EVAL_COMPARE_REGEX_NOT_MATCHING,
EVAL_COMPARE_MATCHING,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For less ambiguity, I would use name EVAL_COMPARE_STRING_MATCHING and EVAL_COMPARE_STRING_NOT_MATCHING.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about naming it better too, I'll modify that then.

@flashcode
Copy link
Member

If possible, could you please add the tests of the new operators in tests/unit/core/test-eval.cpp ?
If you're not sure, I can do it after the merge, not a problem.

@sim642
Copy link
Member Author

sim642 commented Nov 30, 2015

I can also add some tests, sure. Forgot because I don't usually add features to the core.

@flashcode flashcode closed this in ec11a59 Apr 29, 2017
@flashcode flashcode self-assigned this Apr 29, 2017
@flashcode flashcode added this to the 1.8 milestone Apr 29, 2017
@flashcode
Copy link
Member

Thanks, merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants