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

Double meaning for slashes with new regex syntax #726

Open
ppcad opened this issue Dec 12, 2024 · 0 comments · May be fixed by #734
Open

Double meaning for slashes with new regex syntax #726

ppcad opened this issue Dec 12, 2024 · 0 comments · May be fixed by #734
Assignees
Labels
enhancement New feature or request

Comments

@ppcad
Copy link
Collaborator

ppcad commented Dec 12, 2024

The new regex syntax requires filters to have the form "/REGEX/".
To do this it checks if a term begins and ends with a /.
This leads to problems if the filter term has slashes, but shouldn't be treated as regex (i.e. "/some/path/").

Here are some ideas how this could be implemented:

  1. Add escaping for slashes in the rules ("\/some/path\/") and remove them after the regex check
  2. Don't use " for regex, but only /: So /REGEX/ instead of "/REGEX/"

I prefer idea 2.
Right now omitting the quotation marks leads to a crash of Logprep without an explanation that it was caused by a filter syntax error.

@ppcad ppcad added the enhancement New feature or request label Dec 12, 2024
@ppcad ppcad changed the title Slashes with new regex syntax Double meaning for slashes with new regex syntax Dec 12, 2024
@ppcad ppcad linked a pull request Dec 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants