Problem summary
I have this regex python code:
In
lst =[' ', 'US$170.8980\xa0billion', '[2]', '\xa0(2018)']
for i in lst:
pat = re.compile(r'([\x1F-\x7F]+).+(\d+)')
results=pat.search(i)
print(results)
I am getting this ouput with my regex pattern:
Out
None
<_sre.SRE_Match object; span=(0, 11), match='US$170.8980'>
None
<_sre.SRE_Match object; span=(1, 6), match='(2018'>
Desired Ouput
Ideally, I want to get this output:
[US$170.8980-billion-(2018)]
(you need to escape it `('