I can only seem to iterate over the result val once. Calling length iterates over it, and therefore calling result.next
causes an exception.
val result = for ( regex(name) <- regex findAllIn output) yield name
println(result.length)
println(result.next)
The result is AFAIK an Iterator[String], so I'm not sure why I can only iterate on it once.