Support the ongoing development of Laravel.io →
Database Views Blade

$query->where('tags', 'LIKE', '%'.$uID.'%');

SELECT 'a word a' REGEXP '[[:<:]]word[[:>:]]';

How do i use that Word boundary query in laravel query builder

Tried this and still failed $query->whereRaw("tags LIKE REGEXP '[[:<:]]Men[[:>:]]'");

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'REGEXP '[[:<:]]Men[[:>:]]')' at line 1 (SQL: select count(*) as aggregate from items where item_status = ? and (tags LIKE REGEXP '[[:<:]]Men[[:>:]]')) (Bindings: array ( 0 => 2, ))

Last updated 2 years ago.
0

Does it work without a regex? i.e. tags LIKE '%Men%'?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.