I have a rails 4.1.x application using PostgreSQL as the db.
I am needing to query a column in an attempt to do an incase sensitive match on a part of a string, while searching with the boundaries of a word. The regex should be inline with /keyword\b/i so using %keyword% would not cut it. I understand that postgres supports regex, however I am not able to get it working correctly. I currently have the following:
Page.where("title ~* 'keyword/\b'").all
generages the following:
SELECT "pages".* FROM "pages" WHERE (title ~* 'keyword')
This currently does not return anything, even records that I know contain the word "keyword", what am I doing wrong? Or rather, what can I do to get my expected result.