Use variable instead of regex match