fork download
  1. import re
  2.  
  3. str = """------------------
  4. [' 3', ' 8', ' 1'][' 7', ' ', ' 5'][' 6', ' 4', ' 2']
  5. ------------------"""
  6.  
  7. print(re.findall(r"(?<=')\s*\d*(?=')", str))
Success #stdin #stdout 0.02s 9516KB
stdin
Standard input is empty
stdout
[' 3', ' 8', ' 1', ' 7', '  ', ' 5', ' 6', ' 4', ' 2']