PIERCE BROSNAN might have been spared the heartache of losing his beloved daughter Charlotte to ovarian cancer if she had only undergone the same ge­netic testing as Angelina Jolie, says an expert.

Diagnosed with the deadly cancer three years ago, Charlotte endured chemo and radiation treatments before succumbing to the devastating disease on June 28 at age 41. But if she had known that she carried the faulty BRCA gene that’s a marker for breast and ovarian cancer, she might have been able to take lifesaving action, an expert tell The ENQUIRER.

Charlotte was considered high risk for ovarian cancer. Her mom Cassandra, Pierce’s first wife, died from the dis­ease at age 43 in 1991, and Charlotte’s grandmother suffered the same fate.

“The fact that her mother was pretty young when she died of ovarian cancer is a huge tip-off that the disease was inherited,” Dr. Herman Kattlove, a retired oncologist and former spokes­person for the American Cancer Society, told The ENQUIRER.

“Charlotte certainly could have been tested for the BRCA gene mutation. And because of the apparent genetic predis­position, one could have recommended that she remove her ovaries as soon as she was finished with childbearing.”

That’s the route Angelina Jolie is tak­ing. In May, the actress revealed that she had opted to undergo a double mastectomy after testing positive for the mutated BRCA1 gene. She’s also planning to have her ovaries removed as a preventive measure. But Charlotte didn’t take the same path, leaving Pierce haunted, says a source.

“Pierce is heartbroken and kicking himself for not making sure Charlotte was tested for the cancer gene,” confided a longtime friend. “He adored Charlotte and underwent the same agony he suf­fered when his beloved Cassie died.”

Pierce, 60, married Cassandra, the di­vorced mother of two young children, Charlotte and Chris, in 1980. When the children’s father died in 1986, the former James Bond star adopted them. “Charlotte was Pierce’s little princess,” said the source. “But she led a troubled life in her early 30s, battling depression and drug addic­tion. On at least three occasions, she entered rehab before finally defeat­ing her demons.”

Charlotte had secretly married her artist boyfriend Alex Smith two weeks before her death, according to sources. Pierce escorted her down the aisle in what’s been described as a “very moving” ceremony.

“It was not a day to be sad,” said the family friend. “Alex and Pierce were both smiling broadly.”

Sadly, the mom of two, Isabella, 15, and Lucas, 8, was destined to soon lose her brave battle.

“Pierce knew his daughter’s di­agnosis wasn’t good, but he kept hoping and praying she would beat cancer,” said the friend.

“Losing Charlotte has devastated him. We can only hope that time will help him and his family heal.”