I have some sql select queries and I want to extract all those statements wherein a given set of columns (say A,B,C) is being selected from a given table (say X). The regex should be able to match
select A,B,C,D,E from X,Y,Z,(select * from R)
select B,C,A from Y,X
I tried something like this:
select(?=.*\sA)(?=.*\sB)(?=.*\sC).*\sfrom(?=.*\sX).*
but it also matches scenarios like
select D from X,(select A,B,C) from Z