Pattern transform

a long time we speak about it.... Here it is.
I would put all this switch into ``self.match``