Re: REGEXP_REPLACE doesn't comply with the standard, does it ?
From: joel garry <joel-garry_at_home.com>
Date: Tue, 29 Jun 2010 13:44:28 -0700 (PDT)
Message-ID: <074b5887-5c1b-47af-a453-9627109beaef_at_m17g2000prl.googlegroups.com>
On Jun 29, 5:06 am, Spendius <spend..._at_muchomail.com> wrote:
> Hi,
>
> The following works *everywhere* I've ran it:
> $ echo rbcde_fghijkl_mnopq|sed "s/_\([a-z]\)/\u\1/g"
> rbcdeFghijklMnopq
>
> (in vi, at several Unix prompts...: I want to replace letters that
> come after an underscore by their uppercase value, and get
> rid of this underscore)
>
> I've found no way to have the same behaviour using REGEXP_REPLACE:
> SQL> select regexp_replace('rbcde_fghijkl_mnopq','_\([a-z]\)','\u\1')
> from dual;
> REGEXP_REPLACE('RBC
> -------------------
> rbcde_fghijkl_mnopq
>
> How can you then obtain in SQL what I'm getting above in Ux ?
>
> Thanks.
> Spendius
rbcdeFghijklMnopq
Date: Tue, 29 Jun 2010 13:44:28 -0700 (PDT)
Message-ID: <074b5887-5c1b-47af-a453-9627109beaef_at_m17g2000prl.googlegroups.com>
On Jun 29, 5:06 am, Spendius <spend..._at_muchomail.com> wrote:
> Hi,
>
> The following works *everywhere* I've ran it:
> $ echo rbcde_fghijkl_mnopq|sed "s/_\([a-z]\)/\u\1/g"
> rbcdeFghijklMnopq
>
> (in vi, at several Unix prompts...: I want to replace letters that
> come after an underscore by their uppercase value, and get
> rid of this underscore)
>
> I've found no way to have the same behaviour using REGEXP_REPLACE:
> SQL> select regexp_replace('rbcde_fghijkl_mnopq','_\([a-z]\)','\u\1')
> from dual;
> REGEXP_REPLACE('RBC
> -------------------
> rbcde_fghijkl_mnopq
>
> How can you then obtain in SQL what I'm getting above in Ux ?
>
> Thanks.
> Spendius
Well, initcap seems to work with underscores, then you get rid of the underscores?
1 select
replace(replace(initcap('dummy'||'rbcde_fghijkl_mnopq'),'_',''),'Dummy','')
2* from dual
JEG_at_TTST> /
REPLACE(REPLACE(I
rbcdeFghijklMnopq
jg
-- _at_home.com is bogus. http://en.wikipedia.org/wiki/BananadineReceived on Tue Jun 29 2010 - 15:44:28 CDT