Quick Search:
 
 Oracle PL/SQL: Regular Expressions: RegExp examples two Jump to:  
Category: >> Oracle PL/SQL >> Regular Expressions: RegExp examples two  

<< lastnext >>

Snippet Name: Regular Expressions: RegExp examples two

Description: Search for control (non-printing) characters using the first example.

Search for digits using the second example.

Search for lowercase characters using the third example.

Search for UPPERCASE characters using the fourth example.

Search for lowercase characters using the fifth example.

Search for any printable characters using the sixth example.

Search for whitespace characters using the seventh example.

Search for characters in a specific position in the string using the eighth example.

Also see:
» Regular Expressions: REGEXP_SUBSTR
» Regular Expressions: REGEXP_LIKE
» Regular Expressions: REGEXP_REPLACE
» Regular Expressions: RegExp examples t...
» Regular Expressions: RegExp examples o...
» Regular Expressions: Regexp Cheat Sheet
» RegExp: Append first name first letter...

Comment: (none)

Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 12th, 2009

SELECT FROM <table_name>
WHERE REGEXP_LIKE(<column_name>, '[[:<POSIX_CHAR_CODE:]]');
 
-- example to search for a TAB character (ASCII 9):
SELECT *
FROM sandbox
WHERE REGEXP_LIKE(regex_test, '[[:TAB:]]{1}');
 
 
-- example to search for any 2 digits
SELECT *
FROM sandbox
WHERE REGEXP_LIKE(regex_test, '[[:digit:]]{2}');
 
 
-- example to search for lowercase characters
SELECT *
FROM sandbox
WHERE REGEXP_LIKE(regex_test, '[[:lower:]]');
 
 
-- or, search for UPPERCASE characters. In this 
-- case we're looking for four (4) characters 
SELECT *
FROM sandbox
WHERE REGEXP_LIKE(regex_test, '[[:upper:]]{4}');
 
 
-- example to search for printable characters
-- this example looks for three printable characters 
-- as specified by the '{3}' quantifier 
SELECT *
FROM sandbox
WHERE REGEXP_LIKE(regex_test, '[[:print:]]{3}');
 
 
-- example to search for whitespace characters. 
-- this includes space, tab, NL, FF, VT, and CR. 
SELECT *
FROM sandbox
WHERE REGEXP_LIKE(regex_test, '[[:space:]]');
 
-- search for a 'Q' in the fourth position. 
-- notice the start-of-line anchor, '^' is used. 
SELECT * 
FROM sandbox
WHERE REGEXP_LIKE(regex_text, '^...Q.');


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org