expandDollarRefsToMatches - allows $1 and $quoted1