Hi @gem4236 ,
Your question is somewhat difficult to give specific answers to because we don’t actually have much detail about what it is you are doing, even though you have clearly tried to provide detail.
What I mean is, we don’t know what your data looks like, and your SQL contains flow variables which you haven’t explicitly given us the values of. We can probably assume that they contain the values you have given in their names and I guess they also contain single quotes at the beginning and end for this to work syntactically.
I am also confused about whether you are saying the database query is/isn’t working, or whether it is the rule engine you are having trouble with (or both).
Database:
I was a little confused about why you would have two separate database queries, one containing the data you wanted, and the other containing the data you didn’t, as I couldn’t understand what you then intended to do to have these queries work together to somehow filter your data. From a database query perspective, and from what I can read into your question, I would say that the answer given by @denisfi is spot on, (paying particular attention to wrapping each group of “OR” conditions in parentheses) so if that isn’t working, then either your regex is wrong, or your data isn’t as expected, or we are misunderstanding what you are asking.
In your comment, you said you are trying to use non-greedy regex, but if we are to assume that your flow variables contain the regex that you display in their names, then they are not non-greedy (i.e. they are greedy)
Rule Engine:
Does the regex in the Rule Engine match the regex you had in your second database query? It doesn’t look like it, but as already mentioned, we don’t know what the values of your flow variables are, so we cannot be sure.
Further Wildcard searches in Rule Engine with LIKE use “*” as wild cards, not “%” but I wasn’t sure if your mention of trying LIKE ‘%VEGFR%’ was related to the Rule Engine, or the SQL. In SQL terms, IN ( )
is never going to work with wildcards unless you have a DB with an implementation of SQL I’ve not come across before. It would be nice sometimes if it did though! 
The regex you have supplied in the Rule Engine is also “Greedy”. To make it non-greedy (or lazy) you would use .*?
rather than .?
wouldn’t you?
From regex101.com
? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)
*
matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
*? matches the previous token between zero and unlimited times, as few times as possible, expanding as needed (lazy)
So from this, the following Rule Engine condition:
$RESULT_NAME_REPLACE$ MATCHES “(.*?)VEGFR(.*?)”
would only find VEGFR with at most one character either side, I believe, and so would match any of:
xVEGFRy
VEGFRz
pVEGFR
but would not match
xxVEGFRy
VEGFRzz
ppVEGFR
Is that what you intended? I can’t tell without seeing some data and expected results, but I suspect it isn’t.
Maybe you could post a few rows of samples of data and the details of what your flow variables contain, plus your SQL statement in text form so we can work out what you might expect to match the different regex and we can help further.