New grepVar function