Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: String Manipulation
A regex returning the first word from the address should do it:
SQL> select regexp_substr('foo.bar.baz','\w*') from dual;
REG
--- foo Seems more elegant than all the instr(substr(instr()) stuff. I haven't thought through if there are any non-word (\w) characters that could potentially be in a DNS name. -- Jeremiah Wilton ORA-600 Consulting http://www.ora-600.net Shivaswamy Raghunath wrote:Received on Thu May 17 2007 - 14:06:02 CDT
> I need to get "instance" from ('instance.company.com
> <http://instance.company.com>') on SQLPLUS. How I can do this?
-- http://www.freelists.org/webpage/oracle-l
![]() |
![]() |