【发布时间】:2013-01-05 10:21:34
【问题描述】:
在使用匹配约束时,如何转义正则表达式中的正斜杠?这是我尝试过的:
constraints {
url (
matches: "^http://www.google.com/$"
)
}
错误:solution: either escape a literal dollar sign "\$5" or bracket the value expression "${5}"
constraints {
url (
matches: "^http:\/\/www.google.com\/$"
)
}
错误:unexpected char: '\'
【问题讨论】:
标签: grails groovy grails-constraints