title: Scala Regex example not working
body: <p>I'm pretty new to scala, and I'm trying to use regex to solve a problem, but I'm getting an error.</p>
  
  <p>I copied an example directly from the docs (2.10.4), and I'm getting the same error.</p>
  
  <p>What am I missing here:</p>
  
  <pre><code>println(scala.tools.nsc.Properties.versionString)
  val p1 = "ab*c".r
  val p2 = "a(b*)c".r
  
  val p1Matches = "abbbc" match {
    case p1() =&gt; true
    case _    =&gt; false
  }
  </code></pre>
  
  <p>produces:</p>
  
  <pre><code>version 2.10.4
  Exception in thread "main" java.lang.NoSuchMethodError:  scala.util.matching.Regex.unapplySeq(Ljava/lang/CharSequence;)Lscala/Option;
   at SparkGrep$.argsParser(SparkGrep.scala:67)
   at SparkGrep$.main(SparkGrep.scala:23)
   at SparkGrep.main(SparkGrep.scala)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  ...
  </code></pre>
  
  <p>line 67 is the line that says:</p>
  
  <pre><code>  case p1() =&gt; true
  </code></pre>
  
  <p>for reference this example is copied directly from the unappplyseq example at <a href="http://www.scala-lang.org/api/2.10.4/index.html#scala.util.matching.Regex" rel="nofollow">http://www.scala-lang.org/api/2.10.4/index.html#scala.util.matching.Regex</a></p>
  
  <p>Update, I have created an example project where this does, in fact work.  I've figured out that it has something to do withmy build process, but I have no idea why.</p>
  
  <p>Here's the build.sbt for the broken project</p>
  
  <pre><code>name := "logdata-demo-07-22-2015"
  
  version := "1.0"
  
  scalaVersion := "2.10.4"
  
  resolvers ++= Seq(
    "Typesafe Releases" at "http://repo.typesafe.com/ typesafe/releases",
    "spray repo" at "http://repo.spray.io"
  )
  
  resolvers += "spray" at "http://repo.spray.io/"
  
  val sparkVersion = "1.3.0"
  
  libraryDependencies ++= Seq(
    "org.apache.spark" %% "spark-mllib" % sparkVersion,
    "org.apache.spark" %% "spark-sql" % sparkVersion,
    "com.databricks" %% "spark-csv" % "1.1.0",
    "com.github.scopt" %% "scopt" % "3.3.0"
  )
  
  assemblyMergeStrategy in assembly := {
    case m if m.toLowerCase.endsWith("manifest.mf")          =&gt; MergeStrategy.discard
    case m if m.toLowerCase.matches("meta-inf.*\\.sf$")      =&gt; MergeStrategy.discard
    case "log4j.properties"                                  =&gt; MergeStrategy.discard
    case m if m.toLowerCase.startsWith("meta-inf/services/") =&gt; MergeStrategy.filterDistinctLines
    case "reference.conf"                                    =&gt; MergeStrategy.concat
    case _                                                   =&gt; MergeStrategy.first
  }
  
  assemblyOutputPath in assembly := new File("output/logdata-demo.jar")
  </code></pre>