My regexp is:
TMP_REGEXP = r'_\(\s*(.*)\s*\)\s*$'
TMP_PATTERN = re.compile(TMP_REGEXP, re.MULTILINE)
File input_data.txt:
print _(
'Test #A'
)
print _(
'''Test #B'''
'''Test #C'''
)
I am running this like that:
with codecs.open('input_data.txt', encoding='utf-8') as flp:
content = flp.read()
extracted = re.findall(TMP_PATTERN, content)
What I want to achieve is: - take all characters that follow '_(' - end reading characters if there is ')' followed by zero or more whitespaces and end of line
What is interesting 'Test #A' works like a charm bu 'Test #B' is skipped.