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

com.mysema.query.collections.ColQueryFunctions doesn't handle $ and other regex metacharacters #224

Closed
cosmicpaul opened this issue Sep 4, 2012 · 1 comment

Comments

@cosmicpaul
Copy link

@cosmicpaul cosmicpaul commented Sep 4, 2012

com.mysema.query.collections.ColQueryFunctions doesn't handle $ and other regex metacharacters

eg LIKE '$DOG' fails as str.match() treasts the dollar as regex metacharacter

Resulted to passing in prequoted strings into like but would be neater to implement in com.mysema.query.collections.ColQueryFunctions#like

Solution I applied was as follows loop over characters, splitting on % / _ if they're unescaped and use Pattern.quote to handle the regex metachars correctly and rejoin with % / _ chars. com.mysema.query.collections.ColQueryFunctions#like can then replace % / _ with regex equivalent

@timowest
Copy link
Member

@timowest timowest commented Sep 10, 2012

Released in 2.7.3

@timowest timowest closed this Sep 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants