What is the default operator precedence in Oracle's regular expressions when they don't contain parentheses?
For example, given
H|ha+
would it be evaluated as H|h
and then concatenated to a
as in ((H|h)a)
, or would the H
be alternated with ha
as in (H|(ha))
?
Also, when does the +
kick in, etc.?
Given the Oracle doc:
Table 4-2 lists the list of metacharacters supported for use in regular expressions passed to SQL regular expression functions and conditions. These metacharacters conform to the POSIX standard; any differences in behavior from the standard are noted in the "Description" column.
And taking a look at the |
value in that table:
The expression a|b matches character a or character b.
Plus taking a look at the POSIX doc:
Operator precedence The order of precedence for of operators is as follows:
Collation-related bracket symbols [==] [::] [..]
Escaped characters \
Character set (bracket expression) []
Grouping ()
Single-character-ERE duplication * + ? {m,n}
Concatenation
Anchoring ^$
Alternation |
I would say that H|ha+
would be the same as (?:H|ha+)
.