with \w
(非字母数字)
SQL> select str
2 from (select 'attention' str from dual union all
3 select 'look at the tent' str from dual union all
4 select 'tent''s are nice' str from dual union all
5 select 'something tent something' str from dual union all
6 select 'camping,tent,outdoors' str from dual)
7 where REGEXP_LIKE(str, '(\W|^)tent(\W|$)', 'i') ;
STR
------------------------
look at the tent
tent's are nice
something tent something
camping,tent,outdoors
SQL> select str,
2 case when REGEXP_LIKE(str, '(\W|^)tent(\W|$)', 'i') then 'YES' else 'NO' end matches
3 from (select 'attention' str from dual union all
4 select 'look at the tent' str from dual union all
5 select 'tent''s are nice' str from dual union all
6 select 'something tent something' str from dual union all
7 select 'tent' str from dual union all
8 select 'camping,tent,outdoors' str from dual);
STR MAT
------------------------ ---
attention NO
look at the tent YES
tent's are nice YES
something tent something YES
tent YES
camping,tent,outdoors YES