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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Regular Expression confusion

RE: Regular Expression confusion

From: William B Ferguson <wbfergus_at_usgs.gov>
Date: Thu, 21 Apr 2005 07:08:58 -0600
Message-ID: <OF65CF0770.52A65CAB-ON06256FEA.00462698@usgs.gov>


Hi Jared,  

I'm Windows, so I don't have access to dump(). As a workaround, I modified my original SQL statement (that almost works) accordingly, even grabbing a couple different records:  

SQL> select UPPER(regexp_replace(name,'[''''|"|;| |-|,|.]')) test_data, asciistr(name) name,
2 ascii(substr(name,2,1)) code
3 from names
4 where upper(regexp_replace(name,'[[:punct:][:space:]]')) 5 like ('%JBU%')
6 and substr(name,2,1) = '-';

TEST_DATA              NAME                   CODE

---------------------- ---------------------- ----------
A-JBURKHART A-J Burkhart 45 J-BUG J-Bug 45

I've read and re-read the docs and articles I've been able to find, and it seems like I should be able to escape the hyphen like '\-', but that's not working in my character list.

As an aside, I thought the results returned by escaping the hyphen were rather strange also.



Bill Ferguson
U.S. Geological Survey - Minerals Information Team PO Box 25046, MS-750
Denver, Colorado 80225
Voice (303)236-8747 ext. 321 Fax (303)236-4208  

From: jkstill_at_gmail.com [mailto:jkstill_at_gmail.com] Sent: Wednesday, April 20, 2005 5:52 PM
To: William B Ferguson
Cc: oracle-l_at_freelists.org
Subject: Re: Regular Expression confusion

Hi Bill,

Have you tried using dump() on the row?

It is possible that the '-' is not quite what you think it is.

--

Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist
--

http://www.freelists.org/webpage/oracle-l Received on Thu Apr 21 2005 - 09:12:08 CDT

Original text of this message

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