object CurlyBracketMatcher {
def main(args: Array[String]): Unit = {
val str = "This is a {string} with {multiple} {words} wrapped in curly brackets."
// Define the RegEx pattern
val regex = "\\{([^}]+)\\}".r
// Find all matches
val matches = regex.findAllMatchIn(str).map(_.group(1)).toList
println(s"Matches: $matches")
}
}
/*
run:
Matches: List(string, multiple, words)
*/