views:

136

answers:

1

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

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.

(running Oracle 10.2g)

UPDATE:

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$...

+3  A: 

Hi,

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

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`**

Taken from here

carpenteri
Aha, so it's 512 bytes. Thanks!
FrustratedWithFormsDesigner