Skip to main content

Hi Team,

 

I want to extract a particular word from a string, I am using “regexp_substr”, but its not giving result as expected.

 

TAB_NAME : Test TABLE IC_X_CUST_HEADER_F_123_TAB A, CUSTOMER_ORDER B, LEFTJOIN (PURHCASE_ORDER_LINE)

 

From above text, I want to extract the word ‘IC_X_CUST_HEADER_F_123_TAB” , so I wrote below logic.

 

SELECT 
regexp_substr(t.tab_name,
'ic_mA-z]+ 0-9]+) AS output FROM IC_TAB_LIST t;

 

But, its not giving result.

 

can anyone suggest ?

 

Thanks,

Srini 

 

Hi @TechSriniG 
seems your regexp_substr statement is not a completed one.

Try below

SELECT regexp_substr(t.tab_name,
'IC_IA-z]+z0-9]+_]A-z]+') AS output FROM IC_TAB_LIST t;

I tried as below