spacepaste

  1.  
  2. def parse():
  3. """Get code sample content and parse it."""
  4. content = get_file(path)
  5. p = re.search(r'\[block:code](.*?)\[/block]', content, re.S)
  6. r = p.group(1)
  7. whole_sample_dict = json.loads(r)
  8. return whole_sample_dict
  9. # HOW COULD I HAVE A FUNCTION parse(regex) that takes in some regex as param
  10.