Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

case insensitive in regex in postgresql query

I want to search for a list of name through records of another table i want that my regex be case insensitive, but I can not make it work!

SELECT id
  FROM "regexfreeFlickrFullInfo"
  where tags ~ 'tower\s?\*?bridge'  or title ~ 'tower\s?\*?bridge' or descriptio ~ 'tower\s?\*?bridge'  order by id asc;

here is my query, I have tested by i, but it did not work!

like image 622
GeoBeez Avatar asked Sep 01 '16 14:09

GeoBeez


1 Answers

You must use ~* instead of ~.

like image 178
redneb Avatar answered Oct 14 '22 01:10

redneb