title: (Python) which is more efficient to split a string multiple separators? 1) Using multiple replace method then using split 2) using regular Expressions
body: <p>Example:</p>
  <p><strong>(Case 1)</strong></p>
  <p>#first using replace method to replace different type of separator to single type then using split method</p>
  <pre><code>text = &quot;python is, an easy;language; to, learn.&quot;
  text_one_delimiter = text.replace(&quot;# &quot;, &quot;, &quot;).replace(&quot;% &quot;, &quot;, &quot;).replace(&quot;; &quot;, &quot;, &quot;).replace(&quot;- &quot;, &quot;, &quot;)
  
  print(text_one_delimiter.split(&quot;, &quot;))
  </code></pre>
  <p><strong>(case 2)</strong></p>
  <p>#Using regular expression for splitting using multiple separators</p>
  <pre><code>import re
  
  text = &quot;python is# an% easy;language- to, learn.&quot;
  print(re.split('; |, |# |% |- ', text))
  </code></pre>