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

Home -> Community -> Usenet -> c.d.o.server -> Re: REGEXP_like

Re: REGEXP_like

From: cptkirkh <khill_at_scic.com>
Date: 2 May 2007 13:20:44 -0700
Message-ID: <1178137244.136212.75600@c35g2000hsg.googlegroups.com>


On May 1, 12:51 am, "Vladimir M. Zakharychev" <vladimir.zakharyc..._at_gmail.com> wrote:
> On May 1, 1:52 am,cptkirkh<k..._at_scic.com> wrote:
>
>
>
>
>
> > On Apr 29, 5:52 pm, Mladen Gogala <mgogala.SPAM_ME...._at_verizon.net>
> > wrote:
>
> > > On Fri, 27 Apr 2007 22:07:01 -0700, Vladimir M. Zakharychev wrote:
> > > > Indeed, but won't work in 10.1, only in 10.2 and later.
>
> > > I didn't know that, thanks! Unfortunately, I don't have any 10.1
> > > databases to try, all I have are 10.2. All we need now is for Oracle
> > > to take over extproc_perl and implement it as a standard database
> > > language.
>
> > > --http://www.mladen-gogala.com
>
> > Thanks for the help. By looking at the expression of select id from
> > my_table where regexp_like(id,'0[0-9]$') It works but what if you have
> > to accoutn for numbers from 00-99. This looks like it only counts
> > from 00-09. Can you do the following?
>
> > select id from my_table where (regexp_like(id,' [00-09]$') can that
> > then be edited to be changed in the form of [xx - yy]$ where I can
> > change the values xx or yy to any value I wish to limit the query by
> > the last two digits?
>
> Wasn't that your initial requirement to only select those rows ending
> with 00 through 09? As of the second question - no, you need to use
> '[0-9][0-9]$' or '\d\d$'. I'd suggest you read some primer on Regular
> Expressions, there are plenty available on the web. At the very least,
> read the chapter on RE support in Oracle SQL Reference.
>
> Regards,
> Vladimir M. Zakharychev
> N-Networks, makers of Dynamic PSP(tm)
> http://www.dynamicpsp.com- Hide quoted text -
>
> - Show quoted text -

Ok that works great but if you want to give the user the ability to vary the last two digit search by any number how can you account for that? I did read a lot about Regexps and if the user says tyhey want to pull say all those who have a n Id with the last two digits of 00-25. How would you account for that in a RegExp_like? [0-2] gets the first digit but what about the last digit? you can't use [0-2] [0-5]$ don't you rule out 06-09 and 16-19? I will do more reading on regular expressions but if any one has an idea I woud apprecitate it. Thanks. Received on Wed May 02 2007 - 15:20:44 CDT

Original text of this message

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