REGEXP_LIKE
The REGEXP_LIKE can be used in where clause to filter or search for patterns 
in strings as shown in example below.  Using regexp_like, all names that 
have the letter "ha" or those ending in "ie" or "y" are being searched.  For
plain search of all names starting with "s", REGEXP_LIKE(fname, 's') can be 
used.
REGEXP_LIKE simplifies the search with a single condition in comparison to 
LIKE, which would have used three separate conditions in this search.

WITH q_t
as
(SELECT 'Steven'   fname FROM DUAL UNION 
 SELECT 'Stanley'  fname FROM DUAL UNION
 SELECT 'Suhas'    fname FROM DUAL UNION
 SELECT 'Keshav'   fname FROM DUAL UNION
 SELECT 'Stephnie' fname FROM DUAL UNION
 SELECT 'Stephen'  fname FROM DUAL
)
SELECT
  fname
FROM q_t
WHERE REGEXP_LIKE(fname,'ha|ie$|y$');

-- Search IP Address
REGEXP_LIKE(fname,'ha|ie$|y$') Analysis


Regular Expression Date validation
Regular Expression Replace
Regular Expression Substr

Oracle registered trademark of Oracle Corporation.

Last Revised On: March 05th, 2012

  258