From the Super Mario Wiki
Rexes are purple and orange dinosaur-like dragons who inhabit Dinosaur Land and other places, first appearing in Super Mario World. Their name is a reference to the predatory dinosaur Tyrannosaurus rex. They have single horns on their noses, fangs, and small wings with which they can fly. They also wear big red shoes, similar to Yoshi. A recurring trait with all Rexes are their compressive bodies, as their stature becomes flatter when jumped upon.
Super Mario series
Super Mario World
Rexes are rare enemies in Super Mario World who, just as Goombas, put no effort into attacking Mario other than walking into his direction. In order to defeat a Rex, Mario would need to jump on it twice. After being jumped on once, a Rex will simply become flattened and move slightly quicker. A Spin Jump would destroy them with one hit. A Rex could also be defeated by shooting a fireball, hitting it with a cape or running into it while using a Starman. Rexes can also be eaten by Yoshi. Rexes can be found in Yoshi's Island 1, Chocolate Island 2 and Awesome.
Super Mario World television series
Rexes, though simply referred to by the generic term Dinosaurs, make several appearances in the Super Mario World animated series. The Rexes of Super Mario World come in different colors, such as green, red and yellow.
"Send in the Clown"
Rexes first appeared in the episode "Send in the Clown", where several are shown disguised as clowns in King Koopa's "Koopaling Bros. Circus". After several misadventures in their circus act, that the clowns are accidentally revealed to be Rexes, who, upon tearing off their costumes, begin to herd all the circus audience members into a large pit.
"King Scoopa Koopa"
In "King Scoopa Koopa", several multi-colored Rexes are shown to be working as employees at King Koopa's fast-food stand. After it is revealed that King Koopa had planned on mutating the inhabitants of Dome City into Chickadactyls, which he plans on deep-frieing and selling to Rexes, King Koopa sends several Rexes to capture Mario and Princess Toadstool. Mario and Princess Toadstool escape using the Star Path, only to return later to defeat the Rexes using a cape. The Rexes that were not defeated by Caped Mario later escaped down a Warp Tube, along with King Koopa.
"Born to Ride"
In the episode "Born to Ride", two Rex bikers named Duke and Rockman appear. Duke and Rockman, along with their ally, Lulu, attempted to manipulate Yoshi into capturing Mario and Luigi for them, only to be beaten in the end.
In a later episode entitled "Rock TV", two other Rex characters named the Tyrannosaurus Twins appear. The Tyrannosaurus Twins, who were wrestlers, after pummeling Mario and Luigi for sometime, are eventually defeated by Caped Mario.
Nintendo Adventure Books
A Rex has appeared in volume 3 of Super Mario-Kun. He captures the Mario Bros., thinking they're working for Bowser. A stung Yoshi then convinces him that the Mario Bros. are allies. The four then go into Rex's house, as Rex promises to give them food as a apology. However, Kamek and a Koopa then use the kamemeka to brainwash Rex. Rex then makes an inedible material, which Yoshi quickly digests. After some groaning, Yoshi claims it was "delicious". Furious that he did not succeed, Rex then uses a flamethrower to burn Mario and Yoshi, while Luigi dodges in time. Kamek then uses his power to make Rex grow. After the kamamaka falls off, Rex and the others put the kamemeka on Kamek instead, thus ending the chapter.
Super Mario Adventures
Rexes also appear in the Super Mario Adventures comic, where several of them are seen among the attendees at Bowser's wedding to a brainwashed Princess Toadstool. Later on, after Mario, Luigi, Yoshi and a herd of Yoshis crashed Bowser's wedding, a lone Rex is seen among the creatures trying to defeat the Yoshis, only to be trampled by them.
Super Mario Bros. film
Mario & Luigi series
Mario & Luigi: Superstar Saga
Rexes reappeared in Mario & Luigi: Superstar Saga as enemies located on Hoohoo Mountain. Like in Super Mario World, Rexes will attack Mario or Luigi by charging into them; Rexes could also be decreased in size by repeatedly jumping on them in this game as well. When they are at their full size, the Rexes' attacks cannot be dodged or countered. Rexes will drop different items if they were defeated normally or while flattened: they drop Syrups when defeated normally, and either Mushrooms or 1-Up Mushrooms when flattened (they drop Green Peppers instead of 1-Up Mushrooms in the Japanese version). Rexes get healed with fire-based attacks, but take normal damage from thunder attacks.
Mario & Luigi: Partners in Time
Though regular Rexes do not appear in Mario & Luigi: Partners in Time, a Shroob-variant of them, called Shroob Rex do appear. Shroob Rexes are encountered in Shroob Castle and have a different appearance, having pincers, purple scales and glowing red eyes.
Super Princess Peach
Normal Rexes appeared in Super Princess Peach as well. Rexes who have been affected by the Sad Vibe also appeared. They are known as Sad Rexes. Sad Rexes will simply sit and weep to themselves, until they are approached by Princess Peach. They will then proceed to charge at her.
In the Nintendo Monopoly, Rexes only make a very small cameo. They appear on the background of the board, in a screenshot, where Mario is riding a Green Yoshi that is spitting out fire at the Rex. They appear in Mario's FUNdamentals as a playing card when the player plays Go Fish with Mario.
Names in other languages