title: Splitting a string based on a pattern in Python
body: <p>I have long strings such as </p>
  
  <p><code>"123 - Footwear, 5678 - Apparel, Accessories &amp; Luxury Goods, 9876 - Leisure Products"</code></p>
  
  <p>and</p>
  
  <p><code>"321 - Apparel &amp; Accessories, 4321 - Apparel &amp; Accessories &gt; Handbags, Wallets &amp; Cases, 187 - Apparel &amp; Accessories &gt; Shoes"</code></p>
  
  <p>I want to split them based on the pattern "a number, a space, a dash, a space, some string until the next number, a space, a dash, a space or end of string". Notice that the string may contain commas, ampersands, '>' and other special characters, so splitting on them will not work. I think there is a way in Python to split based on regular expressions but I have trouble forming that.</p>
  
  <p>I have a very introductory knowledge of regular expressions. I can form a regex for numbers, as well as for alphanumeric strings, but I don't know how to specify "take everything until the next number starts".</p>
  
  <hr>
  
  <p>Update: Expected output:</p>
  
  <p>first case:</p>
  
  <p><code>["123 - Footwear", "5678 - Apparel, Accessories &amp; Luxury Goods", "9876 - Leisure Products"]</code></p>
  
  <p>second case:</p>
  
  <p><code>["321 - Apparel &amp; Accessories", "4321 - Apparel &amp; Accessories &gt; Handbags, Wallets &amp; Cases", "187 - Apparel &amp; Accessories &gt; Shoes"]</code></p>