Ben Affleck opened up about his divorce from Jennifer Garner.

In an interview with New York Times, Affleck discussed his very public split from the actress.

“The biggest regret of my life is this divorce,” the 47-year-old actor said.

“Shame is really toxic,” the “Good Will Hunting” star commented. “There is no positive byproduct of shame. It’s just stewing in a toxic, hideous feeling of low self-worth and self-loathing.”

The remarks came during a discussion of his new film “The Way Back,” in which Affleck plays a high school basketball coach grappling with an alcohol addiction and a failing marriage.

Affleck has been open about the parallels between the film and his own struggles with drinking and public divorce from Garner, 47.

“I drank relatively normally for a long time,” he said to the outlet. “What happened was that I started drinking more and more when my marriage was falling apart. This was 2015, 2016. My drinking, of course, created more marital problems.”

The two announced their separation in June 2015, and finalized their divorce in October 2018.

They started dating in 2004 and married the following year. Affleck and Garner are parents to three children — daughters Violet, 14, and Seraphina, 11, and son Samuel, 7.

Affleck has been through rehab multiple times in the past, entering most recently in August 2018.

While he is not afraid to discuss it, he emphasized to NYT that he does not wish to dwell on his difficult past.

“It’s not particularly healthy for me to obsess over the failures — the relapses — and beat myself up,” he told the publication. “I have certainly made mistakes. I have certainly done things that I regret. But you’ve got to pick yourself up, learn from it, learn some more, try to move forward.”

Back in December, Affleck’s ex Jennifer Lopez opened up on her former relationship with the movie star.

“Ben wanted to be — believe it or not — quiet and not be in the tabloids,” she confessed about Affleck, who she began dating in 2002. “And it was the beginning of the tabloid era, and we were kinda out there. I remember stacks of magazines and we were on it every week. It was scary. It was overwhelming for both of us.”

“The Way Back” opens in theaters on March 6.