title: How to get Ragel to parse two names separated by (space* ":" space*)?
body: <p>I'd like to parse the following:</p>
  
  <pre><code>name:name
  </code></pre>
  
  <p>where the names start and end with an alnum, and can contain any combination of alnum and spaces inside. They could also be blank. My rules for this are:</p>
  
  <pre><code>identifier = alnum (space* alnum)*;
  name       = (identifier | zlen) &gt;sName $pName %fName;
  </code></pre>
  
  <p>The names can be separated by a colon and optionally spaces inbetween the names and the colon. My rules for this are:</p>
  
  <pre><code>sep = space* ":" space*;
  main := name sep name;
  </code></pre>
  
  <p>This doesn't work because apparently the <code>space*</code> in <code>identifier</code> and the <code>space*</code> in <code>sep</code> confuse the parser. I end up getting the action <code>fName</code> executed in every space of the name. </p>
  
  <p>If I change sep to:</p>
  
  <pre><code>sep = ":";
  </code></pre>
  
  <p>then everything is fine. How do I modify these rules so that the parser does what I intend?</p>
  
  <p><em>Source code for this question here: <a href="https://gist.github.com/1661150" rel="nofollow">https://gist.github.com/1661150</a></em></p>