Rex (born with the birth number CT-7567) is a former Clone Trooper and a major character in the Star Wars franchise. He is a supporting character in Star Wars: The Clone Wars and returned in Star Wars Rebels. He was a Clone Trooper from Kamino and stayed loyal to Ahsoka Tano and the Galactic Republic due to Ahsoka removing his command chip after Order 66, along with Commander Wolffe and Commando Gregor.
Rex fought in the early days of the rebellion against the Empire after encountering Ezra Bridger and the Ghost crew. survived the Battle of Endor that saw to the end of the Empire and redemption of Rex's general, Anakin Skywalker.
Rex greatly admired his leaders, such as Obi-Wan Kenobi, Anakin Skywalker and Ahsoka Tano, all of whom he had worked closely with. He was loyal to the Galactic Republic, Jedi, brothers, and friends and loved them all dearly. He had a photograph taken of him, Cody, Fives, and Echo and treasured it for many years. He was especially close with ARC trooper Jesse, Hardcase, and Tup. Due to the removal of his clone command chip courtesy of Ahsoka, Rex was one of the few who remained loyal to what was left of the Republic and the Jedi Order.
He later grew close with Jedi Padawan Ezra Bridger, becoming a mentor towards the boy and helped inspire him during their first encounter. However, Rex was often in conflict with Bridger's master, Kanan Jarrus, and the two often fought on how Ezra should be trained. However, after saving Ezra and Jun Sato during a mission, Rex and Kanan finally acknowledged each other as firends.
It is also shown that Rex was still haunted by the war, which only heightened when he encountered General Kalani (who was previously involved in the battle of Onderon against Rex). The war is what later caused him to snap at Ezra for delaying his attack on the catwalk. However, it takes Ezra to show how wrong both sides are and that the only true victor for the clone Wars was the Empire. Rex acknowledged his mistake and saw that Ezra was right: they were both programmed to lose, and that they just needed to hear that
Star Wars: The Clone Wars
During the Umbara arc, Rex and the 501st were temporarily under the command of General Pong Krell. However, Krell began undermining Rex and his fellow clones' battle tactics and verbally abusing them. In truth, the General had become corrupted and purposefully sabotaged the Clones with intentions of betraying the Jedi to the Separatists. Rex and his fellow soldiers managed to put a stop to the fallen Jedi's plans and capture Krell. The Republic succeeded in taking the planet from falling into Separatist control, making the battle of Umbara a Republic victory. With Krell their prisoner, Rex was faced with the choice of executing Krell, who mocked the Clone Commander when he hesitated. However, Dogma pulled the trigger in retaliation for the deaths of his brothers.