I have the following query:
SELECT DISTINCT A.REZ FROM
(
SELECT REGEXP_SUBSTR(P_EQUATION, '([A-Z|a-z|0-9]+)\{([0-9|\+|\-| |\*|\/\)\(]+)\}#([A-Z|a-z|0-9|_]+)#',1, LEVEL) AS REZ FROM DUAL
CONNECT BY REGEXP_SUBSTR(P_EQUATION, '([A-Z|a-z|0-9]+)\{([0-9|\+|\-| |\*|\/\)\(]+)\}#([A-Z|a-z|0-9|_]+)#',1, LEVEL) IS NOT NULL
) A;
If I supplied the following input:
P_EQUATION := 'A123{(01+02)*2}#ACCOUNT_BALANCE# + B123{(20+10)/20}#ACCOUNT_BALANCE#';
It gives me the following:
REZ
-------------------------------------
A123{(01+02)*2}#ACCOUNT_BALANCE#
B123{(20+10)/20}#ACCOUNT_BALANCE#
But, although the minus sign is included in the pattern, if I have added it inside the curly brackets, it will not recognize the text anymore as a match!
ex:
P_EQUATION := 'A123{(01-02)*2}#ACCOUNT_BALANCE#';
I'm not able to find a solution to this, it is freaking me out, especially, when I tried to match the minus sign alone it works, if I tried to match digits alone it also works :(
|in character class?[A-Za-z0-9]+alone will work fine|literally if it is there in a string