Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

regexp_like and finding whole words within a string

ToddBarryFeb 8 2011 — edited Feb 8 2011
Trying to find a way to use regexp_like (in 11gR2) to find whole words, not partial matches, within a string.

For example:
create table regex_test (id int, name varchar2(30));

insert into regex_test values (1, 'John featuring Jane');
insert into regex_test values (2, 'Featuring John and Jane');
insert into regex_test values (3, 'John and Jane');
insert into regex_test values (4, 'John featuring');
insert into regex_test values (5, 'John with Jane');
insert into regex_test values (6, 'John and Jane within intro');
The goal here is to find all names containing the words 'featuring' and 'with'. Case-insenstive. Not matching on 'within'.

We're looking for hits on ids 1, 2, 4 and 5 and have not been able to find a good example out there.

Thanks,
Todd
This post has been answered by Frank Kulash on Feb 8 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2011
Added on Feb 8 2011
2 comments
4,123 views