progs/lecture1.scala
changeset 367 e6ae724255a8
parent 364 f1a6fa599d26
child 444 7a0735db4788
--- a/progs/lecture1.scala	Tue Nov 24 09:04:06 2020 +0000
+++ b/progs/lecture1.scala	Tue Nov 24 23:36:21 2020 +0000
@@ -482,6 +482,20 @@
 
 
 
+// Regular Expressions (the built in ones)
+
+val s = """Any so-called "politician" should respect a vote."""
+print(s)
+
+print("""foo""")
+
+val reg = """\d+""".r
+
+reg.findAllIn("bbbbaaabbbaaaccc").toList
+reg.replaceAllIn("bbbbaaabbbaaaccc", "*")
+reg.replaceAllIn("bbbb0aaa1bbba2aac3cc", "_")
+reg.replaceAllIn("bbbb00aaa11bbba232aac33cc", "_")
+
 
 // Further Information
 //=====================