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

Propose new Query method similar to re.search() #32

Closed
wearp opened this issue Oct 10, 2014 · 3 comments · Fixed by #33
Closed

Propose new Query method similar to re.search() #32

wearp opened this issue Oct 10, 2014 · 3 comments · Fixed by #33

Comments

@wearp
Copy link
Contributor

wearp commented Oct 10, 2014

Query.matches(), which uses re.match, searches from beginning of field value. I propose a new feature that mirrors python's re.search and allows matching inside field value, not just a beginning.

Perhaps this could be done by additional parameter to QueryRegex (something like re_method) to distinguish between Query.matches() and Query.search.

I can submit pull request if ready?

@msiemens
Copy link
Owner

Sounds reasonable to me. Pull requests are welcome :)

@msiemens
Copy link
Owner

I renamed it to Query.contains. That way it matches Query.matches better and reads nicer:

where('field').contains('regex')

@wearp
Copy link
Contributor Author

wearp commented Oct 14, 2014

That's cool. Makes more sense. I thought about it at first but saw there was another function with same name. Been away on holidays - only just checked emails.

Sent from my iPhone

On 14 Oct 2014, at 17:41, Markus Siemens [email protected] wrote:

I renamed it to Query.contains to better match Query.matches. That way it reads nicer:

where('field').contains('regex')

Reply to this email directly or view it on GitHub.

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

Successfully merging a pull request may close this issue.

2 participants