Skip to content

Instantly share code, notes, and snippets.

@Karasiq
Last active June 10, 2020 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Karasiq/b5eefd6fc9e192c694117086bf8a078e to your computer and use it in GitHub Desktop.
Save Karasiq/b5eefd6fc9e192c694117086bf8a078e to your computer and use it in GitHub Desktop.
val file = "/Users/user/Downloads/waves.log"
val regex = s"${Regex.quote("http://.wvservices.com:6869")}(/.*)".r.unanchored
val result = Source
.fromFile(file)
.getLines()
.collect { case regex(url) ⇒ url }
.map(s => "\"" + s + "\"")
.toSet
.mkString(",\n")
println(result)
sys.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment