Search the products with ‘^wall$’, ‘\swall\s’, ‘^wall ‘ or ‘ wall$’ in its name. But it should not have results like ‘wallpaper’ or ‘wonderwall’
SELECT *
FROM `products`
WHERE (products.name REGEXP 'wall?[:space]')
ORDER BY products.updated_at DESC
So far the above obviously doesn’t work. What should be the correct way to do this.
Updated the spec for clearer explanation.
1 Answer