Pattern transform

a long time we speak about it.... Here it is.
It would lead to a big function with a lot of switch which will become unreadable.