Здесь мы можем собрать наши буквы, затем держать одну букву в качестве левой границы цифр, которые мы хотим заменить, затем еще одну букву после цифр просто для безопасности, и продолжать захватывать наш конец строковых букв и, наконец, заменить цифрыс $1x$3
:
(.+[a-z])([0-9]+)([a-z].+)

RegEx
Еслиэто выражение нежелательно, его можно изменить или изменить в regex101.com .
RegEx Circuit
jex.im визуализирует регулярные выражения:

Тест
# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"(.+[a-z])([0-9]+)([a-z].+)"
test_str = ("aaaaaaa0aaa\n"
"bbbbbbb0bbbbbb\n"
"cccccc 2.0")
subst = "\\1x\\3"
# You can manually specify the number of replacements by changing the 4th argument
result = re.sub(regex, subst, test_str, 0, re.MULTILINE)
if result:
print (result)
# Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.
Демо
const regex = /(.+[a-z])([0-9]+)([a-z].+)/gm;
const str = `aaaaaaa0aaa
bbbbbbb0bbbbbb
cccccc 2.0`;
const subst = `$1x$3`;
// The substituted value will be contained in the result variable
const result = str.replace(regex, subst);
console.log('Substitution result: ', result);