Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Oracle > help with regex using owa_pattern.match

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-30-04, 11:53
aglio412 aglio412 is offline
Registered User
 
Join Date: Jul 2003
Location: DC Metro
Posts: 27
help with regex using owa_pattern.match

i have a procedure that goes through a column and runs a series of regular expressions. the script was originally written in C# but moved to the db, and i am experiencing some undesired behavior. here's a snippet of the code:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>
create or replace function PATTERN_CHANGE(v_string IN VARCHAR2)
return varchar2 is
Result varchar2(150);
CNS VARCHAR2(16) := '[tdkgpbszfvmnlr]';
begin
Result := aglio_utils.strip_bad(LOWER(v_string));
owa_pattern.change(Result, '(ce)', 'se');
...
owa_pattern.change(Result, 'a(' || CNS || ')e$', 'ey&');

owa_pattern.change(Result, 'e(' || CNS || ')e$', 'iy$1');

...

return(Result);
end PATTERN_CHANGE;

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

if i enter the word "ane", i should receive back "eyn", however, what i get back is:
"eyane"

i'm assuming that oracle's regex has some different quirks...but was hoping someone could provide some insight.

the original code for this line:
owa_pattern.change(Result, 'a(' || CNS || ')e$', 'ey&');
looked like this in C#
'a(' || CNS || ')e$', 'ey$1'

note the $1, which was removed and replaced with the &...however, the following lines are still in the same format from the previous [C#] application.

in a nutshell....

if a word has a_e at the end of it, and that blank is filled with any of these:
tdkgpbszfvmnlr

for the ane example, i want eyn back...any help?
thanks in advance

Last edited by aglio412 : 09-30-04 at 11:57.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On