Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Regular expressions?
"Steve Wilbur" <ultramafic1_at_yahoo.com> wrote in message
news:020520010947302457%ultramafic1_at_yahoo.com...
> Is there a way to use regular exrpessions with oracle? In particular,
> I'm seeking a function something like:
>
> REGEX(ARG1,ARG2)
>
> where ARG1 is the regular expression and ARG2 is the value of interest.
> For example:
>
> select * from employee where REGEX("\d\d$,somecolumn);
>
> would select all records where the value for somecolumn ends with two
> digits. in this case, the regex is pretty simple and you could
> probably use LIKE, but there are plenty for which LIKE will not work,
> and those are the ones I am interested in.
>
> select * from townships
> where not REGEX("^[FUCKS]\d{1,3}[NS]\d{1,3}[EW]$",mtr);
>
> is one i would use a lot if i could.
>
> As it is now, I'm using PERL with DBI to do my queries and doing my
> regular expression matching in perl.
>
> Thanks in advance (:
Regular expressions are, AFAIK, not a part of the SQL standard. Depending on 'flavor' of Oracle (it's in the Enterprise Edition only) Oracle Intermedia is supposed to provide some similar functionality.
Hth,
Sybrand Bakker, Oracle DBA Received on Wed May 02 2001 - 15:31:06 CDT