Sha256: 0729cbc268df1034fa32e64ad4f8b650f52125edb262f992c2c9b3c4de7cf40a
Contents?: true
Size: 560 Bytes
Versions: 11
Compression:
Stored size: 560 Bytes
Contents
module TextRank module CharFilter ## # Character filter to remove email addresses from text. # # = Example # # StripEmail.new.filter!("That is a hard question said candide@gmail.com") # => "That is a hard question said " ## class StripEmail # Simple regex to match most emails EMAIL_REGEX = /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/i # Perform the filter # @param text [String] # @return [String] def filter!(text) text.gsub!(EMAIL_REGEX, '') end end end end
Version data entries
11 entries across 11 versions & 1 rubygems