progs/lecture1.scala
changeset 367 e6ae724255a8
parent 364 f1a6fa599d26
child 444 7a0735db4788
equal deleted inserted replaced
366:1c829680503e 367:e6ae724255a8
   480 
   480 
   481 test()
   481 test()
   482 
   482 
   483 
   483 
   484 
   484 
       
   485 // Regular Expressions (the built in ones)
       
   486 
       
   487 val s = """Any so-called "politician" should respect a vote."""
       
   488 print(s)
       
   489 
       
   490 print("""foo""")
       
   491 
       
   492 val reg = """\d+""".r
       
   493 
       
   494 reg.findAllIn("bbbbaaabbbaaaccc").toList
       
   495 reg.replaceAllIn("bbbbaaabbbaaaccc", "*")
       
   496 reg.replaceAllIn("bbbb0aaa1bbba2aac3cc", "_")
       
   497 reg.replaceAllIn("bbbb00aaa11bbba232aac33cc", "_")
       
   498 
   485 
   499 
   486 // Further Information
   500 // Further Information
   487 //=====================
   501 //=====================
   488 
   502 
   489 // The Scala homepage and general information is at
   503 // The Scala homepage and general information is at