Module: Coo::Helper::RegexpCollection
- Defined in:
- lib/coo/helper/regexp_collection.rb
Class Method Summary collapse
- .n_a_1 ⇒ 单个 number alphabet
- .n_a_u_h_0_n ⇒ 0个或多个 number alphabet undlerline hyphen
- .n_a_u_h_1_n ⇒ Object
Instance Method Summary collapse
Class Method Details
.n_a_1 ⇒ 单个 number alphabet
15 16 17 |
# File 'lib/coo/helper/regexp_collection.rb', line 15 def self.n_a_1 return /^[0-9A-Za-z]$/ end |
.n_a_u_h_0_n ⇒ 0个或多个 number alphabet undlerline hyphen
6 7 8 |
# File 'lib/coo/helper/regexp_collection.rb', line 6 def self.n_a_u_h_0_n return /^[A-Za-z0-9_-]*$/ end |
.n_a_u_h_1_n ⇒ Object
10 11 12 |
# File 'lib/coo/helper/regexp_collection.rb', line 10 def self.n_a_u_h_1_n return /^[A-Za-z0-9_-]+$/ end |
Instance Method Details
#valid_str?(str, valid_regexp) ⇒ Boolean
19 20 21 22 |
# File 'lib/coo/helper/regexp_collection.rb', line 19 def valid_str?(str, valid_regexp) return true if (valid_regexp.match(str)) false end |