Replace substring in string with variable named as substring?
It sounds like you'd be better off using Yii's Message Translations for this, if that's possible in your situation. They are what powers Craft's |t / |translate filter:

{{ "String with {something} and {somethingElse}"|t('site', entry) }}


With this, {something} and {somethingElse} would be replaced with the string values of entry.something and entry.somethingElse.

You can also pass an array for more complex substitutions:

{{ "String with {something} and {somethingElse}"|t('site', {
    something: entry.something,
    somethingElse: entry.somethingElse,
}) }}