Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

regexp_like - how to exclude some patterns

andres31Jun 19 2009 — edited Jun 19 2009
Hi,
i need to find all occurrances of "25" in a column if all the following are met:
1) the preceding character is not "0", "1", "3", "4", "5", "6", "7", "8", "9", "d", ":";
2) the following character (to the 25) is not a number;
3) the following character (to the 25) is not a "." (dot)
4) the following two characters (to the 25) are not "%"" (percent sign plus quotation mark)
--5) the following characters (to the 25) are not ") :=" (closing bracket, any number of spaces/tabs, a colon and an equal sign)--
5) the sequence following 25 should not be "closing bracket, any number of spaces/tabs, colon, equal sign"

it's simple to fulfill the first three, but i'm stuck with the last two, as it seems i cant use multple characters inside [].
{code}
regexp_like(column, '[^013456789d\:]25[^(\.|0|1|2|3|4|5|6|7|8|9|\:|\)[:space:]*?\:\=|\%\")
and i even can't use 
[. .]
when i tried this
regexp_like(tegevus, '[^013456789d\:]25[^\.0123456789[.) .]]'
it told me 
ORA-12731: invalid collation class in regular expression

Any help?

Edited by: andres31 on Jun 19, 2009 4:42 PM

Edited by: andres31 on Jun 19, 2009 5:43 PM
rephrased 5)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
This post has been answered by Frank Kulash on Jun 19 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 17 2009
Added on Jun 19 2009
13 comments
4,386 views