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

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

Comments

Projects
None yet
2 participants
@cosmicpaul

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Sep 10, 2012

Member

Released in 2.7.3

Member

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