regex - Grails g :tags does not support the doller($) sign in regex for pattern ? 为什么?

标签 regex grails

chalice g:tags不支持使用美元 ($) 符号进行内联模式验证。您可以使用 jQuery 验证该字段。但是内联g:tag有什么解决方案吗?使用 grails 支持美元符号?

最佳答案

支持$带转义符的符号 \所以你需要像 \$ 一样使用它
<g:field ............. /> 的示例

<g:field name="abc" type="text" pattern=".*([.,/])\$" />

关于regex - Grails g :tags does not support the doller($) sign in regex for pattern ? 为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36076776/

相关文章:

Grails 2.2.0 应用程序的 Maven 构建失败,JDK 1.7 : Could not find artifact com. sun :tools:jar:1. 6

Grails - application.properties 有什么用

java - 从字符串中删除时间戳

python - 匹配两个通配字符串的优雅方式

javascript - 无效的正则表达式组

将电话号码转换为 tel : links 的 JavaScript

python : find substring with regex in files

grails - Jenkins grails错误java.lang.ClassNotFoundException:geb.transform.AttributeAccessingMetaClassRegisteringTransformation

grails - 在源文件夹中查找 Groovy 类

grails - Nginx 允许页面上出现不安全的内容