import re s = '''rates[ 'inner' ][ 'Находка' ].HKD = { buy: '80,30', buy_arrow: '1', sale: '81,00', sale_arrow: '-1' }; rates[ 'inner2' ][ 'Находка2' ].HKD = { buy: '11000080,222230', buy_arrow: '7', sale: '50,00', sale_arrow: '-50' };''' for match in re.findall(r'(?sm)=\s*{(.*?)};\s*$', s): print(match.strip()) print('------------')