AnnaSophia Robb has bagged the coveted role of Carrie in the Sex And The City prequel.

The 18-year-old will play the character made famous by Sarah Jessica Parker in a new TV show focusing on Carrie coming of age in the 80s, according to The Hollywood Reporter.

AnnaSophia tweeted that she was "so excited" to have been cast in The Carrie Diaries.

"It was online before I even knew hahahaha, oh technology," said the actress, who has appeared in movies such as Charlie And The Chocolate Factory and Soul Surfer.

The show is based on the novel by SATC author Candace Bushnell and will follow Carrie in high school.

It's not known whether younger versions of her Manhattan pals Samantha (Kim Cattrall), Charlotte (Kristin Davis) and Miranda (Cynthia Nixon) will appear, but Running Wilde's Stefania Owen has been cast as Carrie's sister.