Database Reference
In-Depth Information
Modeling
. Model expressions are part of the SPREADSHEET clause
(see Chapter 11).
Note:
The SPREADSHEET clause is renamed as the MODEL clause.
Object Type Constructors
. Expression to instantiate an object from
a type.
There are other expression types, but they are either trivial or repre-
sented fully in other chapters in this topic. What we are really interested in
for this chapter are regular expressions and the Oracle Expression Filter.
Let's start with regular expressions.
14.2
Regular Expressions
1
Oracle regular expressions conform to and enhance POSIX
standards,
much like regular expression support in a programming language such as
Perl. There are two parts to using regular expressions in Oracle SQL. The
first part is the functions that execute regular expression matching, and the
second part is the matching patterns. I am reversing the accepted approach
and examining the functions first. It makes more sense to me to understand
what all of these wonderful patterns are used for before presenting a large
set of meaningless characters.
14.2.1
Regular Expression Functions
Regular expression functions can be used anywhere a function is used, both
built-in and user-defined. Duplicated parameters in the following list are
not explained more than once.
REGEXP_INSTR (source, pattern [, position [, occurrence [,
return [, parameter ]]]])
. Finds the position of a string within a
string.
Position
. Represents the position in a string to begin searching.
Defaulted at position 1.
Occurrence
. Implies that if a pattern exists more than once, then
a position after the first can be found. The default is 1. If a search
passes all occurrences or if there are none, then 0 is returned.
 
Search WWH ::




Custom Search