Source identified1
“’Tis better to have loved and lost Than never to have loved at all.”
Love can remain worth having even when it ends in loss, because avoiding grief by avoiding attachment would also remove the relationship itself.
Source note: In Memoriam A.H.H., Canto 27.