Sha256: 68dc333265055e132334ada28fb92bb8b7a428ff7a8a3132d40f0427c1df916e
Contents?: true
Size: 495 Bytes
Versions: 4
Compression:
Stored size: 495 Bytes
Contents
# Utility class to provide common regular expressions. # origin: RM class Patterns EMAIL = /\A[a-z0-9\+\-_\.]+@[a-z0-9]+[a-z0-9\-\.]*[a-z0-9]+\z/i HOST = /\A[a-z0-9]+[a-z0-9\-\.]*[a-z0-9]+\z/i URL = /(http|https):\/\/[\w\-_]+(\.[\w\-_]+)*([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?/ # Returns a regexp without start-of-string and end-of-string assertions def self.partial(pattern) Regexp.compile(pattern.source.sub(/^(\\A|\^)/, '').sub(/(\\z|\$)$/, '')) end end
Version data entries
4 entries across 4 versions & 1 rubygems