title: Haskell Parsec skip all words that arent predefined
body: <p>Learning to use the Parsec library, part of homework.</p>
  
  <p><strong>EDIT:</strong> Suggestions to use other libraries are welcome, the point is the parsing.</p>
  
  <p>What I want, is to extract all words with a capital letter, and four compass directions from any sentence. Example: "Belgium totally lies south of Holland." should find and return "Belgium south Holland".</p>
  
  <p>What I can't figure is how to ignore (eat) any input that is -not- a compass direction. 
  I was looking to find something along the lines of </p>
  
  <pre><code>'many (not compassDirection &gt;&gt; space)'
  </code></pre>
  
  <p>but g(h)oogle isn't helping me.</p>
  
  <p>Following code is obviously stuck on the 'many' function.</p>
  
  <pre><code>readExpr :: String -&gt; String
  readExpr input = case parse (parseLine) "" input of
      Left err -&gt; "No match: " ++ show err
      Right val -&gt; "Found: " ++ showVal val
  
  parseLine :: Parser GraphValue
  parseLine = do
              x &lt;- parseCountry
              space
              many ( some (noneOf " ") &gt;&gt; space )
              y &lt;- parseCompass
              space
              many ( some (noneOf " ") &gt;&gt; space )
              z &lt;- parseCountry
              return $ Direction [x,y,z]
  
  compassDirection :: Parser String
  compassDirection = string "north" &lt;|&gt;
                     string "south" &lt;|&gt;
                     string "east" &lt;|&gt;
                     string "west"
  
  parseCountry :: Parser GraphValue
  parseCountry = do 
                  c &lt;- upper 
                  x &lt;- many (lower)
                  return $ Country (c:x)
  
  parseCompass :: Parser GraphValue
  parseCompass = do 
                  x &lt;- compassDirection
                  return $ Compass x
  </code></pre>