translate pattern match