ArgumentError: multiline anchors (^ or $)
来源:互联网 发布:手机淘宝开店在哪里 编辑:程序博客网 时间:2024/05/17 22:06
报错信息如下
ArgumentError: The provided regular expression is using multiline anchors (^ or $), which may present a security risk. Did you mean to use \A and \z, or forgot to add the :multiline => true option?
报错原因如下
我写了个邮箱验证,正则中用到了标志一行开头结尾 (^) 和 ($) validates :email, :presence => true, :uniqueness => true, :format=> {:with => /^\w+@\w+\.\w+$/},:length => {:maximum => 40}
解决方法如下
validates :email, :presence => true, :uniqueness => true, :format=> {:with => /^\w+@\w+\.\w+$/,:multiline => true},:length => {:maximum => 40}
阅读全文
0 0
- ArgumentError: multiline anchors (^ or $)
- Ruby:The provided regular expression is using multiline anchors (^ or $), which may present a securi
- anchors
- anchors
- Anchors属性
- U3D Anchors
- anchors数组
- textBox multiline
- logstash multiline
- SCTS and sync anchors
- Perl Learning: 8.3. Anchors
- Documentation/usb/anchors.txt
- Documentation-usb-anchors.txt
- Delphi控件属性Anchors
- unity NGUI Example1 Anchors
- U3D Anchors功能详解
- Anchors in SSD
- marshal data too short (ArgumentError)
- Git-命令行-我与忽略文件 .gitignore 的斗智斗勇
- AWK说明-及语法格式。
- C 语言中 setjmp 和 longjmp
- PagerAdapter使用notifyDataSetChanged 但是视图并为改变的原因。
- spring内置ContextRefreshedEvent事件
- ArgumentError: multiline anchors (^ or $)
- 用指针实现 strncat()
- Android SDK Level
- 数据库基础
- 我印象中的指针与数组1
- 第九天学习java单列工厂
- 华为机试在线编程(一)
- 写reactnative时遇到的一些问题
- 利用反射实现简单的Class对象和Bson文档的转换