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