"40-Year-Old Virgin" actor Shelley Malil was sentenced to life behind bars yesterday for stabbing his ex-girlfriend 23 times back in 2008.
Malil appeared in court in San Diego County yesterday -- where he was convicted of the attempted murder of Kendra Bebe ... who miraculously survived the attacked.
Malil was sentenced to spend 12 years to life in prison ... and will be eligible for parole in 10 years.
In court, Malil said, "I failed miserably, not only as a human being but as a father, son, uncle, brother, friend. What I did to Kendra, I don't have the words to express my remorse."