import scala.util.matching.Regex
object Main {
def main(args: Array[String]): Unit = {
val str = "Scala programming language 'scales' with you from 'small' to 'large applications'"
val regex = new Regex("'([^']*)'")
val matches = (regex findAllIn str).matchData.map(_.group(1)).toList
matches.foreach(println(_))
}
}
/*
run:
scales
small
large applications
*/