Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: regular expressions

Re: regular expressions

From: T <t_at_yahoo.com>
Date: Mon, 9 Jan 2006 09:19:15 +0100
Message-ID: <dpt6bo$sha$1@ss405.t-com.hr>

"DA Morgan" <damorgan_at_psoug.org> wrote in message news:1136482508.658323_at_jetspin.drizzle.com...
>T wrote:
>> Is any way to use regular expressions on 9.X Oracle databases, and how?
>> Or it is 10g feature???
>
> To a limited extent you can find support in the OWA_PATTER built-in
> package.
>
> So, for example, the following are equivalent:
>
> CREATE OR REPLACE FUNCTION owa_match(phone# VARCHAR2)
> RETURN BOOLEAN IS
>
> BEGIN
> RETURN owa_pattern.MATCH(phone#,'^[0-9]{3}-[0-9]{3}-[0-9]{4}$');
> END owa_match;
> /
>
>
> CREATE OR REPLACE FUNCTION regexp (string_in VARCHAR2)
> RETURN BOOLEAN IS
>
> BEGIN
> IF NOT REGEXP_LIKE
> (string_in,'^([[:digit:]]{3}-[[:digit:]]{3}-[[:digit:]]{4}|[[:digit:]]{10})$')
> THEN
> RETURN False;
> ELSE
> RETURN True;
> END IF;
> END regexp;
> /
>
>
> Of course the REGEXP runs in 140 seconds on my test data whereas the OWA
> package takes 6921 but what's a little time when you are still in 9i? ;-)
> --
> Daniel A. Morgan
> http://www.psoug.org
> damorgan_at_x.washington.edu
> (replace x with u to respond)

Perhaps i must upgrade my databases to 10g, it is the best solution. Thanks for advice. Received on Mon Jan 09 2006 - 02:19:15 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US