title: Splitting string using backslash using regex
body: <p>For a python program I have an input that I am taking from <code>stdin</code> and the input is something like: </p>
  
  <pre><code>"-------/--------\---------/------\"
  </code></pre>
  
  <p>When I print it out as a string value it is printed as it is. I am trying to split the string into a list of strings based of forward and backward slash while keeping the separators as well. I have used something like this:</p>
  
  <pre><code>re.split('(\\/)',string)
  </code></pre>
  
  <p>but the result that I get is:</p>
  
  <pre><code>['------' , '/' , '--------\\\\---------' , '/' , '---------\\\']
  </code></pre>
  
  <p>I was rather expecting it to be something like:</p>
  
  <pre><code>['------' , '/' , '---------' , '\' , '---------', '/' , '---------' , '\']
  </code></pre>
  
  <p>What am I doing wrong here and how to solve this problem?</p>