regex - Canned Regexps for Ruby? -
does ruby have gem provides canned set of regular expressions (ala perl's regexp::common module)? if not, how community share commonly-needed regexps? thanks.
yes, kind of.
there gem called ruby_regex exact thing. github page:
add gemfile gem 'ruby_regex' in models validates_format_of :email, :with => rubyregex::email
and have listed regex for:
rubyregex::url rubyregex::domain rubyregex::email rubyregex::username rubyregex::ussocialsecurity rubyregex::generalpostalcode rubyregex::zipcode rubyregex::creditcard rubyregex::mastercard rubyregex::visa rubyregex::twitterusername rubyregex::delicioususername rubyregex::slidesahreusername rubyregex::githubusername rubyregex::uuid rubyregex::dbdate rubyregex::dbdatetime rubyregex::spanishbankaccountnumber rubyregex::dni
i'm not sure if support else. there lots of little one-off projects this. haven't been able find complete perl module.
i found 1 called cregexp has limited numbers of them well.