use regexp for legend width/height