progs/matcher/cw1.sc
changeset 968 d8d8911a3d6f
parent 967 ce5de01b9632
equal deleted inserted replaced
967:ce5de01b9632 968:d8d8911a3d6f
   120 given Conversion[String, Rexp] = (s => charlist2rexp(s.toList))
   120 given Conversion[String, Rexp] = (s => charlist2rexp(s.toList))
   121 
   121 
   122 extension (r: Rexp) {
   122 extension (r: Rexp) {
   123   def ~ (s: Rexp) = SEQ(r, s)
   123   def ~ (s: Rexp) = SEQ(r, s)
   124   def % = STAR(r)
   124   def % = STAR(r)
       
   125   def | (s: Rexp) = ALT(r, s)
   125 }
   126 }
   126 
   127 
   127 
   128 
   128 println("EMAIL:")
   129 println("EMAIL:")
   129 val LOWERCASE = ('a' to 'z').toSet
   130 val LOWERCASE = ('a' to 'z').toSet