You should do googling more about oracle regexp.
Please try with this.(above Oracle 11g)
SELECT REGEXP_SUBSTR(mssg, '\[[^0-9]*(\d+)[^0-9]*\]', 1, 1, NULL, 1) description
FROM book;
** This helped me to answer here.
UPDATE: This will be OK.
SELECT REGEXP_SUBSTR('No information was found [{AI1234}].', '[[({][^0-9]*(\d+)[^0-9]*[]})]', 1, 1, NULL, 1) description
FROM dual;
UPDATE: Final solution
SELECT REGEXP_SUBSTR('No information was found [{AI1234}].', '[[({]+([^][)(}{]*)[])}]+', 1, 1, NULL, 1) description
FROM dual;
Here, you should take care to [^][)(}{]
.
DO NOT swap the bracket chracters.
I'll quote from Oracle 11g Regexp reference
[ ]
Bracket expression for specifying a matching list that should match any one of the expressions represented in the list. A non-matching list expression begins with a circumflex (^) and specifies a list that matches any character except for the expressions represented in the list.
To specify a right bracket (]) in the bracket expression, place it first in the list (after the initial circumflex (^), if any).
To specify a hyphen in the bracket expression, place it first in the list (after the initial circumflex (^), if any), last in the list, or as an ending range point in a range expression.
This part - [^ ]
- was a hard nut to crack and finally I found solution from the reference, that's why I emphasis this.