implemented Pattern::reverse()