rewrite tab remap, add pattern