replace d3 patters with rexexp