Groovy already has a lot of ways to define a String value, and with Groovy 1.8 we have another one: the dollar slashy String. This is closely related to the slashy String definition we already knew (which also can be multi-line by the way, added in Groovy 1.8), but with different escaping rules. We don't have to escape a slash if we use the dollar slashy String format, which we would have to do otherwise.
def source = 'Read more about "Groovy" at http://mrhaki.blogspot.com/' // 'Normal' slashy String, we need to escape / with \/ def regexp = /.*"(.*)".*\/(.*)\// def matcher = source =~ regexp assert matcher == 'Groovy' assert matcher == 'mrhaki.blogspot.com' // Dollar slash String. def regexpDollar = $/.*"(.*)".*/(.*)//$ def matcherDollar = source =~ regexpDollar assert matcherDollar == 'Groovy' assert matcherDollar == 'mrhaki.blogspot.com' def multiline = $/ Also multilines are supported. /$