fork download
  1. import re
  2. x='def{{{12.197835/// -0.001172, 12.19788 7.3E-5, //+{{12.196705 -1.7E-5, 12.196647 -0.001189///}}}Def'
  3. print(re.findall(r'[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?', x)) # Extracting all numbers into a list
  4. print(",".join(re.findall(r'[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?', x))) # Creating a comma-separated string
Success #stdin #stdout 0.02s 9536KB
stdin
Standard input is empty
stdout
['12.197835', '-0.001172', '12.19788', '7.3E-5', '12.196705', '-1.7E-5', '12.196647', '-0.001189']
12.197835,-0.001172,12.19788,7.3E-5,12.196705,-1.7E-5,12.196647,-0.001189