fork(2) download
  1. import re
  2. s = r'abc123d, hello 3.1415926, this is my book'
  3. pattern = r'-?\d*\.?\d+'
  4. L = re.findall(pattern, s)
  5. print(L)
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
['123', '3.1415926']