| Regexp_Substr [message #634098] |
Wed, 04 March 2015 08:00  |
Xandot
Messages: 235 Registered: January 2014 Location: India
|
Senior Member |
|
|
Hello All,
Query:-
select regexp_substr('this is: a,b,c,d','[^,]+',1,1) from dual;
I want Output like :-
a
------------
but when I add ":" into the regexp:-
select regexp_substr('this is: a,b,c,d',':[^,]+',1,1) from dual;
It gives me output ": a" but I want only "a" in output.
Please help me out.
Thanks
Xandot
|
|
|
|
|
|
|
|
| Re: Regexp_Substr [message #634103 is a reply to message #634100] |
Wed, 04 March 2015 08:14   |
 |
Michel Cadot
Messages: 68776 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
You can't with regexp_substr but you can do it with regexp_replace:
SQL> select regexp_replace('this is: a,b,c,d','^[^:]*: ([^,]+),.*$','\1') from dual;
R
-
a
|
|
|
|
|
|