title: How to write an Scala parser for arithmetic operations including string?
body: <p>I am trying to use <a href="http://www.artima.com/pins1ed/combinator-parsing.html" rel="nofollow">Scala Combinator-Parsing</a> to parse and arithmetic operation in which at least one of the variables is string. I am a beginner in scala and I like this feature of it!
  For instance I wanna parse:<br>
                  (number + 2) * 4</p>
  
  <p>It has a good example of parsing numbers (float and integer with parenthesis) like:</p>
  
  <pre><code>  class Arith extends JavaTokenParsers {  
        def expr: Parser[Any] = term~rep("+"~term | "-"~term)
        def term: Parser[Any] = factor~rep("*"~factor | "/"~factor)
        def factor: Parser[Any] = floatingPointNumber | "("~expr~")"
      } 
  </code></pre>
  
  <p>and this one for string:</p>
  
  <pre><code>       object MyParsers extends RegexParsers {
          val ident: Parser[String] = """[a-zA-Z_]\w*""".r
         }
  </code></pre>
  
  <p>how can I change the first part to parse string beside numbers?</p>