Does
Lo siento por lo haber intentado.
work?
Or does it have to be haberlo intentado?
Does
Lo siento por lo haber intentado.
work?
Or does it have to be haberlo intentado?
The correct form would be
Siento haberlo intentado.
In Spanish the object pronouns la, le, lo etc. are always enclitic (they follow the verb) if it's an infinitive, and they're written as one word with it. This is in contrast to other Romance languages which either allow freedom in the position of the pronoun or prescribe that it must be proclitic to (i. e. attached in front of) the verb.
You can use the same construction (in this case) substituting lamentar for sentir.
Lamento haberlo intentado.
For more examples see the relevant section of Wikipedia's article on Spanish pronouns.
Another option that does not use the infinitive:
Perdona que lo intentara
In this case, as the verb is not in its infinitive form, the object pronoun goes before it. You can use the infinitive in this other option:
Perdón por haberlo intentado.
In this case you must insert "por", as in the English "sorry for...".
"Lo siento" can only be used in some special ways. I will modify your question slightly, to be more in line with idiomatic (natural) Spanish, and then address what you asked. I'll use "Me disculpo" for the "I'm sorry" part. "Me disculpo" means "I apologize."
Does this work?
Me disculpo por lo haber intentado.
Or does it have to be the following?
Me disculpo por haberlo intentado.
Answer: it has to be the latter (por haberlo intentado). Reason: "haber" is an infinitive. When you have an object pronoun and an infinitive, you have to use the scotch-tape method (haberlo -- notice that "haber" and "lo" got scotch-taped together). On the other hand, when the verb is conjugated, then you can use the separated method:
Lo intento, si crees que vale la pena. (I'll try, if you think it's worthwhile.)