One of the first rules of Girl Code (and Guy Code, for that matter) is not to date your friends' exes , but hey — weren't rules made to be broken? Most of us probably couldn't fathom hooking up with our pal's past loves, but for some Hollywood stars, it seems like all bets are off when it comes to finding love. You might be surprised at some of the celebrity friends  who have dated the same person; keep reading to see them now.
Cameron Diaz and Kate Hudson Both Dated . . .
. . . Alex Rodriguez
Both actresses were linked to the baseball player — Kate in 2009 and Cameron in 2010 — and may also have been "locked in a bitter battle" over him, according to Us Weekly  at the time.
. . . and Justin Timberlake!
After Cameron and Alex began hooking up in May 2010, Us Weekly reported  that Kate was "pissed" and thought it was "payback" for when she hooked up with Justin Timberlake  in January 2007, just days after he and Cameron broke up after four years of dating. Cameron and Kate seemed to patch things up, though, as they were seen hanging out at the Vanity Fair post-Oscars bash in 2012, and in a 2013 sit-down with Interview , Cameron referred to Kate as her "good friend."
Selena Gomez and Miley Cyrus Both Dated . . .
. . . Nick Jonas!
Miley and Nick dated in 2006 and broke things off in 2007. Selena and Nick hooked up the following year and dated on and off until 2010. All three of them wrote about the love triangle  in their songs.
Nikki Reed and Ashley Greene Both Dated . . .
. . . Ryan Phillippe!
The Twilight costars were both linked to Reese Witherspoon 's ex-husband, Nikki in 2007 and Ashley in 2013.
Courteney Cox and Jennifer Aniston Both Dated . . .
. . . Adam Duritz!
Somewhat surprisingly, both of the Friends stars dated the Counting Crows frontman back in the '90s. Jennifer and Adam were linked for a short time in 1995 — he's said in interviews  that they "never even slept together" — and Courteney dated the singer in 1997 after she appeared in the Counting Crows video for "A Long December."
Katy Perry and Taylor Swift Both Dated . . .
. . . John Mayer!
Katy and John began their romance in 2012 and famously dated on and off for almost two years; they broke up for good in February 2014. Taylor was linked to John back in 2009, although it's not clear how long their relationship lasted — though we do have her song "Dear John" and his tune "Paper Doll" to help put the pieces together .
Owen Wilson and Lance Armstrong Both Dated . . .
. . . Sheryl Crow
Sheryl and Owen dated in the '90s, and Lance began seeing the singer in 2003. They dated for nearly three years (and got engaged) but called it quits in February 2006.
. . . and Kate Hudson!
Owen and Kate dated from 2006 to 2007 after meeting on the set of You, Me and Dupree, but their relationship was on and off through 2009. Kate and Lance began seeing each other in May 2008, not long after she and Owen broke things off. They split in July of that year, but it doesn't seem like Owen and Lance have stayed friends since then.
Drew Barrymore and Kristen Wiig Both Dated . . .
. . . Fabrizio Moretti!
Drew dated Fabrizio from 2002 to 2007, and Kristen began her romance with The Strokes' drummer in 2011. Kristen and Drew starred together in 2009's Whip It, and in the January 2013 issue of Allure , Drew touched on Kristen and Fab's relationship, saying, "It all seems so wacky and incestuous, but that's kind of how life works," adding, "It seems fitting that they would find each other. I was like, 'Right, of course, that makes perfect sense.'" Fabrizio and Kristen called it quits in July of that year.
Taylor Swift and Selena Gomez Both Dated . . .
. . . Taylor Lautner!
Taylor Swift  dated Taylor Lautner  for three months (from August to November) in 2009, but before then, he was linked to the singer's BFF Selena Gomez . Selena told Seventeen in September of that year  that she met the Twilight star in Canada, saying, "Kristen [Stewart] was staying in my hotel. He would visit her, so we were constantly running into each other in the lobby and we ended up meeting." She added, "We would go out to lunch and dinner, but I knew he had paparazzi following him and I had paparazzi following me. So we literally just wanted to hang out, go bowling and stuff, and it went a little too far, I think. People were getting a little crazy about us. But it was fun — I went to Vancouver thinking I was going to focus on my work, but instead I got to meet him, and it ended up being the best thing ever."
Nick Cannon and Nick Lachey Both Dated . . .
. . . Kim Kardashian!
Nick Lachey  and Nick Cannon both dated Kim Kardashian  briefly in 2006. The former 98 Degrees member, who went on to marry Jessica Simpson  and Vanessa Minnillo , told Details magazine  in 2013 that they "went to a movie," adding, "No one followed us there. Somehow, mysteriously, when we left, there were 30 photographers waiting outside. There are certain ways to play this game, and some people play it well." Nick Cannon has talked about his and Kim's sex life in various interviews, and most recently, he revealed that blabbing about his relationship with her is what caused his impending divorce from Mariah Carey .
Lindsay Lohan and Hilary Duff Both Dated . . .
. . . Aaron Carter!
You know you remember this one: teen stars Lindsay and Hilary were pals before Hilary and Aaron started dating in 2000 (they were just 13 years old). According to Aaron , they dated for "like a year and a half," before he "got a little bored" and began getting to know Lindsay. "Then I didn't want to do that anymore, so I got back with Hilary. And then I ended up cheating on Hilary with her best friend," he added in a 2006 interview.
Taylor Swift and Ellie Goulding Both Dated. . .
. . . Calvin Harris!
Ellie Goulding dated the DJ back in 2014, and Taylor was first linked to him after they were spotted getting cozy at a concert  in Nashville in March. What's more, Ellie and Taylor have both dated members of One Direction — Niall Horan and Harry Styles, respectively.
Ellie recently admitted to setting Calvin and Taylor up, telling The Sun , "I did play matchmaker, that's true. Calvin is a really great mate and he's so fantastic, and Taylor is such a cool person who I love. I thought, 'They're both really awesome and both really tall, they'll be brilliant together."
Jennifer Lopez and Cameron Diaz Both Dated . . .
. . . Sean Combs!
Jennifer famously dated Sean "Puff Daddy" Combs from 1998 to 2001, and Cameron was casually linked to the rapper  and entertainment mogul multiple times between 2008 and 2012. The ladies starred together in 2012's What to Expect When You're Expecting and laughed off any feud rumors  in an interview with Ellen DeGeneres  that year.
Heather Locklear and Denise Richards Both Dated . . .
. . . Richie Sambora!
Heather and Richie were married from 1994 to 2007. Shortly after their split (three months, to be exact), Richie began dating Heather's best friend, Denise, who had just filed for divorce from Charlie Sheen . The hookup was said to have been the reason that Denise and Heather's friendship ended, but in June 2008, Denise told Redbook : "I was no longer friends with Heather months before Richie and I got together. I don't want to say what caused the split, but she and I weren't even speaking then. It wasn't ever like we'd be shopping and go back to her house and I'd flirt with her husband. Yes, I got together with Heather's soon-to-be ex-husband, but no, I didn't have an affair with him. If Heather and I had been friends at that time, I would never have crossed that line. But we weren't. The friendship was not salvageable, and in the beginning Richie and I just talked as friends because we were dealing with similar situations. We never planned for anything to happen."
Nikki Reed and Nina Dobrev Both Dated . . .
. . . Ian Somerhalder!
Nina and Ian dated for three years before their split in May 2013, and Ian began dating Nikki in July 2014. Ian and Nina were reportedly both friends with Nikki and her husband, Paul McDonald, who broke things off in March. Ian and Nikki got married  in April 2015.
Taylor Swift, Gigi Hadid, Demi Lovato, and Ashley Greene All Dated . . .
. . . Joe Jonas!
OK, this one is a doozy: Taylor and Joe dated briefly in 2008 (he reportedly dumped her over the phone, and true to form, she wrote a song about it ). Joe began dating Demi Lovato in March 2010, but they split a few months later. In Summer 2010, he and Ashley started a relationship; they broke up in May 2011, and in November, Ashley spoke about Demi's personal troubles , saying, "I'm really happy that she's doing well," adding, "She and I never had a problem with each other, but you know, it doesn't go away. Jen Aniston still gets asked about Angelina Jolie ."
In June 2015, Joe began romancing Gigi Hadid , who is one of Taylor's recent pals. Gigi starred in Taylor's "Bad Blood" music video and has been spotted on multiple outings with her, including a group lunch with Joe. Taylor admitted her friends' overlapping relationships in a recent Vanity Fair interview  when talking about how the group stays drama-free, saying, "We even have girls in our group who have dated the same people. It's almost like the sisterhood has such a higher place on the list of priorities for us. It's so much more important than some guy that it didn't work out with."