Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
regexes I love you
Browse files Browse the repository at this point in the history
  • Loading branch information
ilanpillemer committed Jul 29, 2017
1 parent d82d4de commit d05520b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/controllers/HomeController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ object RoomActor {
}

class RoomActor(out: ActorRef) extends Actor {

val pattern = """(?s)(\w+),([^,]*),(.*)""".r
def receive = {
case "marco" => out ! ("polo")
case msg: String =>
out ! ("I received your message: " + msg)
case pattern ("roomHello", id, payload) => out ! ("Hi Mediator")
case pattern ("roomGoodbye", id, payload) => out ! ("Bye Mediator")
case _ => out ! ("whatever, I dont care...")
}

override def preStart = out ! ("""ack,{
Expand Down

0 comments on commit d05520b

Please sign in to comment.