Can a variable reference be used on RHS side of JavaRegex condition

nope

You can’t do that.