Extracting numeric values from a string containing key:value pairs
You usually want a zero-width word boundary \b on either end of the regex, to avoid matching things like 1a:1a.

There's no need to capture [a-z]+ since you are throwing it away. 

You can use lookbehind (?&lt;=…) assertions to require a match to be preceded by whatever, without including the whatever in the match result.  This means no need for capturing parenthesis, only the integer is included in the match, and the final map is simply _.toInt. Variable-width lookbehind was introduced in Java 9; older versions have only fixed-width lookbehind.

Finally, removing the variable makes braces unnecessary.

def numericValues(text: String): List[Int] = """(?&lt;=\b[a-z]+\s*:\s*)\d+\b""".r.findAllIn(text).toList.map(_.toInt)


With only fixed-width lookbehind, you could postprocess the matches to remove non-numerics:

….map(_.replaceAll("[^0-9]", "").toInt)


Or, more idiomatically and less hacky, just capture the digits and extract the capture groups:

"""\b[a-z]+\s*:\s*(\d+)\b""".r.findAllIn(text).matchData.toList.map(_.group(1).toInt)