Hi All,
Suppose that i have following string piece:
name:ali#lastname:kemal#name:mehmet#lastname:cemal
I need
ali
mehmet
I use following statement
SQL> select lst, regexp_replace(lst,'(name:)(.*)(lastname)(.*)','\2',1,1) nm from (
2 select 'name:ali#lastname:kemal#name:mehmet#lastname:cemal' as lst from dual
3 );
LST NM
-------------------------------------------------- --------------------------------------------------------------------------------
name:ali#lastname:kemal#name:mehmet#lastname:cemal ali#lastname:kemal#name:mehmet#
SQL>
But it does not return names correctly. When i change 5th parameter(occurence) of regexp_replace built-in function(e.g. 1,2), i may get ali and mehmet respectiveley.
Any ideas about regexp?
Note : I can use PL/SQL instr/substr for this manner; but i do not want to use them. I need regexp.
Regards...
Mennan