title: Test all alternative patterns in PEG.js
body: <p>I want to use PEG.js to recognize numbers in a few different formats:</p>
  
  <pre><code>number = integer
  / real
  / (integer/real) '^' (integer/real)
  / (integer/real) '^^' (integer/real)
  
  real = [0-9]+ '.' [0-9]*
  / [0-9]* '.' [0-9]+
  
  integer = [0-9]+
  </code></pre>
  
  <p>PEG.js does not look for alternatives if there is a partial match earlier in the sequence of alternatives. Most numbers start with an integer, and if they don't they start with a real number. How can I rewrite this so that it tests each alternative individually? (I am not interested in compounding the rules into fewer rules.)</p>