[ad_1]
Try this one with the help of regex.
In [105]: import re
In [106]: m = re.findall('\${(.+?)}', string)
In [107]: m
Out[107]: ['data1', 'data2', 'data3']
7
[ad_2]
solved Pattern matching and extracting it in the string occurrences
[ad_1]
Try this one with the help of regex.
In [105]: import re
In [106]: m = re.findall('\${(.+?)}', string)
In [107]: m
Out[107]: ['data1', 'data2', 'data3']
7
[ad_2]
solved Pattern matching and extracting it in the string occurrences