新手问题 \A [[:lower:]] 这个表达式中的:lower:是什么语法

QETHAN · December 18, 2017 · Last by QETHAN replied at December 19, 2017 · 1387 hits
lass Person < ApplicationRecord
  validates_each :name, :surname do |record, attr, value|
    record.errors.add(attr, 'must start with upper case') if value =~ /\A[[:lower:]]/
  end
end

ri Regexp 有真相

嗯,明白了,多谢指点@luikore, @zaqmjuop

QETHAN closed this topic. 19 Dec 08:42
You need to Sign in before reply, if you don't have an account, please Sign up first.