If I have a string representation of list
s = '["a", "b", "c"]'
l = ["a", "b", "c"]
val str = """["a","b" "c"]""" // string with quote marks
val getStrs = "\"([^, ]+)\"".r // regex to isolate quoted strings
Now to pull those quoted strings (without the quote marks) into a List[String]
.
val lst = (for (m <- getStrs findAllMatchIn str) yield m group 1).toList
// lst: List[String] = List(a, b, c)