Using REGEXP_SUBSTR [message #620211] |
Wed, 30 July 2014 02:37 |
|
mist598
Messages: 1195 Registered: February 2013 Location: Hyderabad
|
Senior Member |
|
|
Hi ,
SELECT
REGEXP_SUBSTR('500 Oracle Parkway, Redwood Shores, CA',',[^,]+,')REGEXPR_SUBSTR
FROM DUAL;
output is:
----------
, Redwood Shores,
SELECT
REGEXP_SUBSTR('500 Oracle Parkway, Redwood Shores, CA,America',',[^,]+,')REGEXPR_SUBSTR
FROM DUAL;
output is:
----------
, Redwood Shores,
[^,]+ -->Oracle Database searches for a comma followed by one or more occurrences of non-comma characters followed by a comma
can you please explain why i am getting same output here
|
|
|
|
Re: Using REGEXP_SUBSTR [message #620214 is a reply to message #620211] |
Wed, 30 July 2014 03:16 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
mist598 wrote on Wed, 30 July 2014 13:07
[^,]+ -->Oracle Database searches for a comma followed by one or more occurrences of non-comma characters followed by a comma
can you please explain why i am getting same output here
Is this what you were looking for in your second case?
SQL> SELECT regexp_substr('500 Oracle Parkway, Redwood Shores, CA,America',
2 ',[^,].+,') regexpr_substr
3 FROM dual;
REGEXPR_SUBSTR
---------------------
, Redwood Shores, CA,
where, "." matches any character in the supported character set (except NULL)
|
|
|
|