I have the following strings from a oracle db table
AM-X1-X4-XX5
BI-TG-GF2
G7-FF
I am using regexp_substr to select 3 Columns from the table like this:
AM|X1|X4
BI|TG|GF2
G7|FF|(null)
the current statement looks like this
select
regexp_substr(c, '[^-]+',1, 1) as p1,
regexp_substr(c, '[^-]+',1, 2) as p2,
regexp_substr(c, '[^-]+',1, 3) as p3,
from table;
so far so good. Now i need to transform the regex or sql statement in a way that it excludes the strings 'AM' and 'BI'. My select statement should return the following table:
X1|X4
TG|GF2
G7|FF
So I tried to adapt the regex statement as below, so it does skip matches equal to 'AM' or 'BI'
(?!AM)(?!BI)(?!-)\w+
However, it does not work. Any help how to create the second table either by adapting the sql or regex-statement is appreciated
\b(?!AM)(?!BI)\w+