Description: REGEXP_LIKE is similar to the LIKE condition, except REGEXP_LIKE performs regular expression matching instead of the simple pattern matching performed by LIKE. This condition evaluates strings using characters as defined by the input character set.
Language: PL/SQL Highlight Mode: PLSQL Last Modified: March 14th, 2009
REGEXP_LIKE(source_string, pattern [, match_parameter ])-- examples:-- Select domains that contain 2 and only 2 letters:SELECT*FROM domains
WHERE regexp_like (key,'^[a-z]{2}$');-- The following query returns the first and last names for -- those employees with a first name of Steven or Stephen -(WHERE first_name begins WITH'Ste'AND ends WITH'en'ANDIN-- between is either 'v' or 'ph'):SELECT first_name, last_name
FROM employee_table
WHERE REGEXP_LIKE (first_name,'^Ste(v|ph)en$');-- This query returns the last name for employees with a -- double vowel in their last name (where last_name contains -- two adjacent occurrences of either a, e, i, o, or u, -- regardless of case):SELECT last_name
FROM employee_table
WHERE REGEXP_LIKE (last_name,'([aeiou])\1','i');
LAST_NAME
-------------------------
De Maab
Greenberg
Soo
Green
Greene
Klopp
-- search for valid email addresses:SELECT page_content
FROM test_list
WHERE REGEXP_LIKE (page_content,'[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}');-- search only for '.com' email addresses:SELECT email
FROM email_list
WHERE REGEXP_LIKE (email,'[A-Z0-9._%-]+@[A-Z0-9._%-]+\.com');
SQL University.net courses meet the most demanding needs of the business world for advanced education
in a cost-effective manner. SQL University.net courses are available immediately for IT professionals
and can be taken without disruption of your workplace schedule or processes.
Compared to traditional travel-based training, SQL University.net saves time and valuable corporate
resources, allowing companies to do more with less. That's our mission, and that's what we deliver.