9.11. Regular Expression Groups
Groups are useful to get subexpressions of regular expressions. Add parentheses around the subexpressions that you want to extract, for example:
val numitemPattern = "([0-9]+) ([a-z]+)".r
You are currently reading a PREVIEW of this book.
Get instant access to over
$1 million worth of books and videos.
Start a Free Trial