Вы можете использовать
(?<![\d(])\d+\)
См. Демоверсию regex
Подробности
(?<![\d(])
- не допускается di git или (
непосредственно слева от текущего местоположения \d+
- одна или несколько цифр \)
- )
char.
Ниже приведен фрагмент кода Python , заключающий совпадения с {{
и }}
(только для демонстрационной цели):
import re
text = "1) Remove the modern cement (20) render to the front of all three properties 2) Inspect the sole plate and studs at front of all three properties, repair where possible, and replace where rotten 3) Apply sawn lath and lime render 4) Finish with limewash including pigment to as closely match existing colour as possible (30)"
print( re.sub( r'(?<![\d(])\d+\)', r'{{\g<0>}}', text) )
Вывод:
{{1)}} Remove the modern cement (20) render to the front of all three properties {{2)}} Inspect the sole plate and studs at front of all three properties, repair where possible, and replace where rotten {{3)}} Apply sawn lath and lime render {{4)}} Finish with limewash including pigment to as closely match existing colour as possible (30)