当Oracle正则表达式不包含括号时,默认运算符优先级是多少?
例如,给定
H|ha+
是否将其评价为H | h,然后连接到((H | h)a)中的a,或者H是否与(H |(ha))中的ha交替?
此外,什么时候开始等等?
解决方法
鉴于
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.
并看看|该表中的值:
The expression a|b matches character a or character b.
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 |
我会说H | ha与(?:H | ha)相同.