Regular Expression
637697Mar 13 2009 — edited Mar 13 2009
Hello All,
Can anybody help me out in tackling tis issue, I have to create an regular expression for split the string into 3 Parts skipping the delimiter '+'
Example like "My+Name+Is" it split as My, Name, Is and must be assigned to 3 Variables that can hold the 3 values.
SAP+ORCL+CRM should be split into SAP, ORCL, CRM into 3 parts individually .
I have created one, but its not working Properly for 3 combination its working fine by if i give 2 combination like SAP+ORCL its not working properly and also for single value like SAP here it will take 3rd position i.e. will be assigned to 3rd variable insted for the 1st.
u can try out
SELECT
substr(:P25_test,0,instr(:P25_test,'+')-1) a,
substr(:P25_test,instr(:P25_test,'+')+1,instr(:P25_test,'+',1,2)-1-instr(:P25_test,'+')) b,
substr(:P25_test,instr(:P25_test,'+',1,2)+1) c from dual ;
And later it should be assigned to 3 hidden item like :P25_PILLAR_HIDDEN, :P25_PROD_HIDDEN,:P25_CAT_HIDDEN
Hope its clear and quick reply will be appreciated
Thanks and Regards,
Suri