Let\'s say I have this code:
val string = \"one493two483three\" val pattern = \"\"\"two(\\d+)three\"\"\".r pattern.findAllIn(string).foreach(println)
You want to look at group(1), you're currently looking at group(0), which is "the entire matched string".
group(1)
group(0)
See this regex tutorial.