Oracle-确定正则表达式支持的最大大小 [英] Oracle - Determine maximum supported size for regular expression

查看:164
本文介绍了Oracle-确定正则表达式支持的最大大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个抛出ORA-12733的正则表达式,正则表达式太长".如何确定最大支持大小?

I have a regular expression that throws ORA-12733, "regular expression is too long". How do I determine what the maximum supported size is?

仅供参考:令人反感的正则表达式为892个字符.这是一个生成的正则表达式,因此我可以更改生成和执行它的方式,但是在更改生成和执行方式之前,我想知道最大大小的限制.

FYI: the offending regex is 892 characters. It's a generated regex, so I could change how I generate and execute it, but I would like to know what the limits to the max size are before I change how I am generating and executing.

(运行Oracle 10.2g)

(running Oracle 10.2g)

更新:

如果它取决于实际的正则表达式,则这是它的开始(其余重复的只是同一件事,在^$之间具有不同的值):

If it depends on the actual regex, here's the begining of it (the rest is just the same thing repeated, with different values between ^ and $):

(^R_1A$|^R_2A$|^R_3A$|^R_4A$|^R_4B$|^R_5A$|^R_5B$ ...

推荐答案

查看正则表达式函数REGEXP_SUBSTR,REGEXP_INSTR&的文档. REGEXP_REPLACE该模式的引号如下:

Looking at the documentation for the regex functions, REGEXP_SUBSTR, REGEXP_INSTR & REGEXP_REPLACE it has the following quote for the pattern:

pattern是正则表达式.通常是文字 文字,可以是任何 数据类型CHAR,VARCHAR2,NCHAR或 NVARCHAR2. 最多可包含512个 个字节.如果模式的数据类型是 与的数据类型不同 source_char,Oracle数据库转换 模式的数据类型 source_char.对于的清单 您可以在其中指定的运算符 模式`**

pattern is the regular expression. It is usually a text literal and can be of any of the datatypes CHAR, VARCHAR2, NCHAR, or NVARCHAR2. It can contain up to 512 bytes. If the datatype of pattern is different from the datatype of source_char, Oracle Database converts pattern to the datatype of source_char. For a listing of the operators you can specify in pattern`**

来自此处

这篇关于Oracle-确定正则表达式支持的最大大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆