在 Oracle 的 regexp_replace
中函数中,有一个参数 replace_string
,您可以在其中指定反向引用 \1
到 \9
。
有没有办法引用第 9 个之后的反向引用? Oracle 将 \10
视为 \1
后跟文字 0
。
最佳答案
不,最多九个。
\n
Backreference
Matches the nth preceding subexpression, that is, whatever is grouped within parentheses, where n is an integer from 1 to 9.
-- http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10471/adfns_regexp.htm#ADFNS1013
请注意,这不是 Oracle 的限制。许多(大多数?)正则表达式实现的最大值是九。
关于regex - 是否可以在 Oracle 的 regexp_replace 中引用第 10 个及后续替换字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1564981/