RegEx Not Preceeded By or Followed By
963434Sep 20 2012 — edited Sep 21 2012I am trying to find references in a varchar column that contains two digits but is not preceeded by a : and is not followed by digits. I am trying to do this via Regular Expressions.
I would like the following returned:
22hihi
22hihi22
But not:
:22hi
:22
2222
This seems like a fairly straight forward thing but I am having difficulties with it. This is on a Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit
This is what I have tried as a text. I would think this would not return a match because the first [^:] would exclude the string.
select case when regexp_like(':123', '[^:]\d{2}') then 'Match Found' else 'No Match Found' end as columnname1 from dual