Name
[: :] (Character Class) — Specifies a character class
Synopsis
Use [: and :]
to enclose a character class name,
for example: [:alpha:]
. Character classes must be
specified within bracket expressions, as in
[[:alpha:]]
.
The following example uses the character class
[:digit:]
to match the digits in a ZIP code:
SELECT REGEXP_SUBSTR(
'Munising MI 49862',
'[[:digit:]]{5}') zip_code
FROM dual;
49862
In this example, we could just as well have used the pattern
[0-9]{5}
. However, in multilingual environments
digits are not always the characters 0-9. The character class
[:digit:]
matches the English 0-9, the
Arabic-Indic
٠–٩, the Tibetan ༠–༩, and so forth.
Table 1-5 describes the character class names recognized by Oracle. All names are case-sensitive.
Class |
Description |
|
Alphanumeric characters (same as |
|
Alphabetic characters only |
|
Blank space characters, such as space and tab |
|
Nonprinting or control characters |
|
Numeric digits |
|
Graphical characters (same as |
|
Lowercase letters |
|
Printable characters |
|
Punctuation characters |
|
Whitespace characters such as space, form-feed, newline,carriage return, horizontal tab, and vertical tab |
|
Uppercase letters |
|
Hexadecimal characters |
Get Oracle Regular Expressions Pocket Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.