Sha256: 77cdcfa2339f0605bf645ad2739c46afe68d6b831b60d3dd8e8cd7fadf4ecd65

Contents?: true

Size: 284 Bytes

Versions: 4

Compression:

Stored size: 284 Bytes

Contents

class String
  # Like #scan but returns MatchData ($~) rather
  # then matched string ($&).
  #
  #   require 'facet/string/mscan'
  #
  def mscan(re) #:yield:
    if block_given?
      scan(re) { yield($~) }
    else
      m = []
      scan(re) { m << $~ }
      m
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facets-0.6.3 lib/facet/string/mscan.rb
facets-0.7.0 lib/facet/string/mscan.rb
facets-0.7.1 lib/facet/string/mscan.rb
facets-0.7.2 lib/facet/string/mscan.rb