Parse ANSI escape sequence