Exact search of a word in the text:
I had the following problem.
I wanted to search for all contacts that have "cto" as the exact word in the headers, but the results returned results with the name "Director" in it, I used the following query
select * from contacts where title ilike '%cto%';
I also tried with whitspaces around the wildcard as "% cto%", it matched the text that contains "cto", got results like "vp, cto and manger" but not results with the exact title like "cto",
I wanted the results "vp, cto and manger" and "cto" to be obtained, but not the "director" in the results
After me they worked
select * from contacts where title ~* '\\ycto\\y'; ~ Matches regular expression, case sensitive ~* Matches regular expression, case insensitive
Pramod Shinde Apr 22 '15 at 13:15 2015-04-22 13:15
source share