implement pattern * and #