-
Notifications
You must be signed in to change notification settings - Fork 372
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
Support $regex
's x
option
#592
Comments
Hi, I was studying a little bit a codebase yesterday and I'm interested in this issue. Wouldn't you mind if I take that on me? |
Sure. Please make sure that you add good tests for that. I will try to help with fuzzing as soon as possible :) |
There's not too much about free-spacing mode on internet, as far as I found there are also small differences between engines, finally some of them doesn't implement it at all... My approach is to use every regex input with "x" flag as an argument in a function which just translates multi-line, free-spaced, commented regex into a string understandable by Go However I'm not sure if my condidtions correspond to the intended behavior. Conditions that I'm not sure:
I have tried to find an answer in mongodb source code but still I'm not sure about that. Also I understand that there's a lot of work to do on this project so I will just try to implement that this way and continue to search. |
@noisersup would you please join slack? https://join.slack.com/t/ferretdb/shared_invite/zt-zqe9hj8g-ZcMG3~5Cs5u9uuOPnZB8~A |
@seeforschauer I'm already there! |
Doing a regexp pattern preprocessing as described above would require full-fledged regex parsing to avoid issues when working with The Go standard I used this package to do regexp parsing in a couple of linters: It supports most of the PCRE syntax as well, which can be handy since MongoDB uses this dialect. |
Cover with great tests and fuzzing.
DoD:
$regex
as this issue is mentioned thereThe text was updated successfully, but these errors were encountered: