title: TypeError for re.split in Python
body: <p>I have a question about using re for Python on re.split.
  Firstly, the records list contains 100 data.
  When I tried to retrieve a specfic data, it works:</p>
  
  <pre><code>content = records[0].get("AB") #I'm getting the article content from pubmed btw
  nom = []
  nom = re.split(r"\B\s(?=[^\s:]+:)", content) #trying to split into paragraphs
  print nom
  </code></pre>
  
  <p>However, if i try to retrieve the full set of data using for in, I'm getting typeerror which expected string or buffer. This is the code:</p>
  
  <pre><code>for record in records:
      content = record.get("AB")
      nom = []
      nom = re.split(r"\B\s(?=[^\s:]+:)", content)
      print nom
  </code></pre>
  
  <p>The error:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):<br>
    File "", line 4, in <br>
    File "/usr/lib64/python2.6/re.py", line 167, in split<br>
    return _compile(pattern, 0).split(string, maxsplit)<br>
    TypeError: expected string or buffer  </p>
  </blockquote>
  
  <p>Anyone can explain to me why is this happening? How can I correct it to retrieve the full set of data?</p>