Sha256: 3b6e24ce82cd78bd937d9e3da0e4ad7c7debcef9c98e2657c68cf0faf3e6005c

Contents?: true

Size: 269 Bytes

Versions: 7

Compression:

Stored size: 269 Bytes

Contents

class String

  # Like #scan but returns MatchData ($~) rather
  # then matched string ($&).
  #
  #   CREDIT: Trans

  def mscan(re) #:yield:
    if block_given?
      scan(re) { yield($~) }
    else
      m = []
      scan(re) { m << $~ }
      m
    end
  end

end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
facets-2.4.0 lib/facets/string/mscan.rb
facets-2.4.1 lib/facets/string/mscan.rb
facets-2.4.2 lib/core/facets/string/mscan.rb
facets-2.4.3 lib/core/facets/string/mscan.rb
facets-2.4.4 lib/core/facets/string/mscan.rb
facets-2.4.5 lib/core/facets/string/mscan.rb
mack-facets-0.8.2 lib/gems/facets-2.4.5/lib/core/facets/string/mscan.rb