title: Regular expression to transform string to list (Python)
body: <p>A program outputs a file with lines of the following format</p>
  
  <pre><code>{Foo} Bar Bacon {Egg}
  </code></pre>
  
  <p>where <code>Foo</code> and <code>Egg</code> could, but do not have to, be made up of several words. <code>Bar</code> and <code>Bacon</code> always are a single word.</p>
  
  <p>I need to get <code>Bar</code> in a variable for my further code. I imagine that this would work if I split the sting at a matching regular expression. This would return a list of the four elements and thus I could easily get out the second element with <code>list[1]</code>.</p>
  
  <p>How would I write such a regular expression?</p>
  
  <p>I need to split the sting on single spaces <code>' '</code>, but only if that single space is not surrounded by text in curly braces.</p>
  
  <p><code>\s(?=[a-zA-Z{}])</code> gives me all the spaces and thus behaves exactly like <code>' '</code>. How can I exclude the spaces in the curly braces?</p>