import res = '{{ SITE_AGGREGATE_SUBNET }}.3 remote-as {{ BGP-AS }}'print(re.findall(r'{{\s*((?:(?!{{|}})[^-])*-.*?)\s*}}', s))
Standard input is empty
['BGP-AS']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!