-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Fix multiline regex #46298
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
Fix multiline regex #46298
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a way to add a test for this, is there not?
| @@ -180,6 +180,10 @@ impl SearchQuery { | |||
| } | |||
|
|
|||
| let multiline = query.contains('\n') || query.contains("\\n"); | |||
| if multiline { | |||
| query.insert_str(0, "(?m)"); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can there be a situation when a query already contains this?
Then, we'll spoil it by doing so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a really good observation thanks! I just tested it and it works just the same as if you hadn't included it.
|
@SomeoneToIgnore Good catch. Just added a test. Thank you! |
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Closes #45776
It didn't enable multiline mode before
¯\_(ツ)_/¯. If there is a reason this fix won't work please let me know but it seems like this one was just an easy fix.Release Notes: