开发者

Is it possible to refer to a 10th and subsequent replacement strings in Oracle's regexp_replace?

开发者 https://www.devze.com 2022-12-09 00:31 出处:网络
In Oracle\'s regexp_replace function, there is a parameter replace_string in which you can specify backreferences 开发者_JAVA技巧\\1 to \\9.

In Oracle's regexp_replace function, there is a parameter replace_string in which you can specify backreferences 开发者_JAVA技巧\1 to \9.

Is there a way to refer to backreferences after the 9th one? Oracle treats \10 as \1 followed by a literal 0.


Nope, nine is the max.

\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

Note that this is not an Oracle limitation. Many (most?) regex implementations' maximum is nine.

0

精彩评论

暂无评论...
验证码 换一张
取 消