@polesye Is there a reason to have a different notation for rectangles and regions? Why not have

'rectangle': '[[10,10], [20,30]] , [[12,12], [40,60]]'

And as with regions, if there's only one rectangle, the outer brackets could be optional.

I find having two different syntaxes a bit confusing.