progs/crawler3.scala
changeset 399 5c1fbb39c93e
parent 329 dbba38a5c2ae
child 427 546f2090ce12
--- a/progs/crawler3.scala	Tue Mar 22 17:09:24 2016 +0000
+++ b/progs/crawler3.scala	Wed Apr 06 11:51:33 2016 +0100
@@ -12,7 +12,7 @@
 
 // regexes for URLs, for "my" domain and for email addresses
 val http_pattern = """"https?://[^"]*"""".r
-val email_pattern = """([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})""".r
+val email_pattern = """([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})""".r (*@\label{emailline}@*) 
 
 def unquote(s: String) = s.drop(1).dropRight(1)
 
@@ -27,7 +27,7 @@
   else {
     println(s"Visiting: $n $url")
     val page = get_page(url)
-    print_str(email_pattern.findAllIn(page).mkString("\n"))
+    print_str(email_pattern.findAllIn(page).mkString("\n")) (*@\label{mainline}@*) 
     for (u <- get_all_URLs(page).par) crawl(u, n - 1)
   }
 }