Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Regular Expression confusion
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.
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