问题描述
在Oracle的 regexp_replace
函数,有一个参数replace_string
,您可以在其中指定向后引用\1
到\9
.
In Oracle's regexp_replace
function, there is a parameter replace_string
in which you can specify backreferences \1
to \9
.
是否有一种方法可以在第9个引用之后引用反向引用? Oracle将\10
视为\1
,后跟文字0
.
Is there a way to refer to backreferences after the 9th one? Oracle treats \10
as \1
followed by a literal 0
.
推荐答案
不会,最多是九个.
后向引用
匹配第n个 前面的子表达式,即 分组内的任何东西 括号,其中n是整数 从1到9.
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
-- http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10471/adfns_regexp.htm#ADFNS1013
请注意,这不是Oracle的限制.许多(最多?)正则表达式实现的最大值是9.
Note that this is not an Oracle limitation. Many (most?) regex implementations' maximum is nine.
这篇关于是否可以在Oracle的regexp_replace中引用第10个及以后的替换字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!