I can't achieve to make sqlfiddle work so here is my simple code :
select REGEXP_SUBSTR(' EG SUZ SG SIN blabla ', '^(\s?[A-Z]{2} [A-Z]{3}\s?){2}') from dual;
I want to get SG SIN
. I know REGEXP_SUBSTR
got a parameter used to get the nth occurrence but when I write
select REGEXP_SUBSTR(' EG SUZ SG SIN blabla ', '^(\s?[A-Z]{2} [A-Z]{3}\s?){2}'),1,2) from dual;
it returns nothing and 1,1
returns EG SUZ SG SIN
so my guess is that the occurrence is not rightly splitted,but I don't know why, can you explain me?