Re: String Manipulation
- From: "Jared Still" <jkstill@xxxxxxxxx>
- To: jeremiah@xxxxxxxxxxx
- Date: Thu, 17 May 2007 16:34:02 -0700
On 5/17/07, Jeremiah Wilton <jeremiah@xxxxxxxxxxx> wrote:
A regex returning the first word from the address should do it:
SQL> select regexp_substr('foo.bar.baz','\w*') from dual;
16:32:27 SQL>l
1* select regexp_substr('foo-1.bar.baz','[a-z|A-Z|0-9|-]*') from dual
16:32:28 SQL>/
REGEX
-----
foo-1
1 row selected.
There's probably a metacharacter to shorten that regex, but I can't
remember and too lazy to look.
--
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist
- Follow-Ups:
- Re: String Manipulation
- From: Carel-Jan Engel
- References:
- String Manipulation
- From: Shivaswamy Raghunath
- Re: String Manipulation
- From: Jeremiah Wilton
Other related posts:
- » String Manipulation
- » RE: String Manipulation
- » Re: String Manipulation
- » Re: String Manipulation
- » RE: String Manipulation
- » Re: String Manipulation
- » Re: String Manipulation
- » Re: String Manipulation
- » 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;
- Re: String Manipulation
- From: Carel-Jan Engel
- String Manipulation
- From: Shivaswamy Raghunath
- Re: String Manipulation
- From: Jeremiah Wilton