score:0

Accepted answer

You want the first match:

r.findFirstMatchIn(queryResult.toString).map(_.group(1))

(Will be an Option[String].)

That said, I'd use a streaming JSON parser every time over a regex. Yes, the regex is faster, but unless this is really a bottleneck, I would be more worried about accuracy.


Related Query

More Query from same tag