Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

allow searching including newlines #308

Closed
wants to merge 1 commit into from
Closed

allow searching including newlines #308

wants to merge 1 commit into from

Conversation

vbud
Copy link
Contributor

@vbud vbud commented Jul 16, 2015

Use a match any character set ([\s\S] instead of .) to fix 'contains', 'like', 'startsWith', and 'endsWith' queries to work with multi-line strings.

This is a different way of solving the problem of #220 and #221, and it was recommended by @andyhu as a better way of solving the problem than adding the m flag, which breaks startsWith and endsWith.

My specific use case is similar to the HTML one - I want to search across a string of markdown that has newlines in it.

Use a match any character set ([\s\S] instead of .) to fix 'contains', 'like', 'startsWith', and 'endsWith' queries to work with multi-line strings.
@devinivy
Copy link
Contributor

@particlebanana mind taking a peek? It's short. Are multiline string matches considered a luxury of mongo or should other adapters support this as well? In that case, a test would be great to accompany this.

particlebanana pushed a commit that referenced this pull request Jan 25, 2016
@particlebanana
Copy link
Contributor

There were 3 pr's that essentially did this. I manually cherry picked this commit.

cc #242 #221

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants