I have written a RegExp to catch all the parameters and associated values of a SQL (JDBC) query.
I am using this.
(?:\S+\s)?\S*"myOperatorHere\S*(?:\s\S+)?
So that I can catch parameters like: Where c.value = 32
I can get c.value
and 32
It works well with all the operators except IN
I'd like to catch where c.value IN (3,4,5,6)
But with this expression I get (3,
as a value instead of (3,4,5,6)
For example if I have the query:
SELECT C.NAME, C.FIRSTNAME FROM CUSTOMER C, PROSPECT P WHERE C.ID = 32 AND C.TRUC = 28 AND P.ID < 12 AND P.A IN (2, 3, 4)
I'd like to get C.ID = 32, C.TRUC = 28, P.ID < 12, P.A IN (2, 3, 4)
Could you please help me manage this? I can use two expressions if needed.