Can two conditions be given for python's string.split function?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4998629/python-split-string-with-multiple-delimiters">Python: Split string with multiple delimiters</a>  </p>
</blockquote>



<p>I have a program where I am parsing a file by each line and splitting it into two half.  After that for each half I am parsing each word from the line and appending it in a list. </p>

<p>Here mfcList1 is a list of lines from a text file. I am parsing each word in the line that are either separated by a comma or by a space. But it isn't exactly working.</p>

<pre><code>for lines in mfcList1:
        lines = lines.lstrip()
        if lines!='':
            p.append(string.split(lines,','or " "))
mfcList2 = reduce(lambda x,y:x+y,p)

print mfcList2
</code></pre>

<p>When i am using string.split it is working with only those elements who end with a comma it is ignoring the <strong>or</strong> operator I am using with split method. I want to slice off each and everyword from the line. They either end with a comma or with a space. </p>

<p>for eg. '<strong>enableEmergencySpare=1 useGlobalSparesForEmergency=1 useUnconfGoodForEmergency=1</strong>',</p>

<p>this line is being stored as a single list element where as I am trying to split them using split method..</p>

<p>Can anyone pls suggest what i can do instead of using or operator... thanks..</p>
