title: Scala Regex. Strange regular expression
body: <p>Please have a look at the REPL session below. The only difference between both regexes is order of characters in square brackets. Thus, both should yield the same output. For some reason second regex omits first sequence (<code>123</code>). What's happening here? :)</p>
  
  <pre><code>Welcome to Scala version 2.9.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).
  Type in expressions to have them evaluated.
  Type :help for more information.
  
  scala&gt; """[^+-.,&gt;&lt;\[\]]+""".r.findAllIn("123]asdf") foreach { println }
  123
  asdf
  
  scala&gt; """[^+-&gt;&lt;\[\].,]+""".r.findAllIn("123]asdf") foreach { println }
  asdf
  </code></pre>