Google Groups

RE: [play-framework] Re: [2.0-scala] custom route with :

Razvan Cojocaru May 7, 2012 3:14 PM
Posted in group: Play Framework

Appreciate that – wondering though if there is a solution or we need a defect – I think this deserves a defect since the idea is in fact meant to work.


I see the parser for the routes uses this rule for the respective dynamic and static parts


  def singleComponentPathPart: Parser[DynamicPart] = (":" ~> identifier) ^^ {
        case name => DynamicPart(name, """[^/]+""")



 def staticPathPart: Parser[StaticPart] = (not(":") ~> not("*") ~> not("$") ~> """[^\s]""".r +) ^^ {

        case chars => StaticPart(chars.mkString)



While the path starts with the “bad” one so I couldn’t find a workaround


def path: Parser[PathPattern] = "/" ~ ((positioned(singleComponentPathPart) | positioned(multipleComponentsPathPart) | positioned(regexComponentPathPart) | staticPathPart) *) ^^ {
        case _ ~ parts => PathPattern(parts)



From: [] On Behalf Of biesior
Sent: May-04-12 3:22 PM
Subject: Re: [play-framework] Re: [2.0-scala] custom route with :


I don't know the way for escaping this char, so I suggested you a workaround :) that's all what I can do

W dniu piątek, 4 maja 2012 20:55:32 UTC+2 użytkownik Razvan Cojocaru napisał:

I’m sorry – I guess my question is: is there a way to escape the : character in a route?


You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at