title: Scala capture group using regex
body: <p>Let's say I have this code:</p>
  
  <pre><code>val string = "one493two483three"
  val pattern = """two(\d+)three""".r
  pattern.findAllIn(string).foreach(println)
  </code></pre>
  
  <p>I expected <code>findAllIn</code> to only return <code>483</code>, but instead, it returned <code>two483three</code>. I know I could use <code>unapply</code> to extract only that part, but I'd have to have a pattern for the entire string, something like:</p>
  
  <pre><code> val pattern = """one.*two(\d+)three""".r
   val pattern(aMatch) = string
   println(aMatch) // prints 483
  </code></pre>
  
  <p>Is there another way of achieving this, without using the classes from <code>java.util</code> directly, and without using unapply? </p>