Escape tag name in pattern