Sha256: 64643da7e3beb5e9a7161c5880af2d9c98e36be77771c146e8b52fd0d4faca68

Contents?: true

Size: 267 Bytes

Versions: 17

Compression:

Stored size: 267 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

17 entries across 16 versions & 1 rubygems

Version Path
facets-2.9.3 lib/core/facets/string/mscan.rb
facets-2.9.2 src/core/facets/string/mscan.rb
facets-2.9.2 lib/core/facets/string/mscan.rb
facets-2.9.1 lib/core/facets/string/mscan.rb
facets-2.9.0 lib/core/facets/string/mscan.rb
facets-2.9.0.pre.2 lib/core/facets/string/mscan.rb
facets-2.9.0.pre.1 lib/core/facets/string/mscan.rb
facets-2.8.4 lib/core/facets/string/mscan.rb
facets-2.8.3 lib/core/facets/string/mscan.rb
facets-2.8.2 lib/core/facets/string/mscan.rb
facets-2.8.1 lib/core/facets/string/mscan.rb
facets-2.8.0 lib/core/facets/string/mscan.rb
facets-2.7.0 lib/core/facets/string/mscan.rb
facets-2.6.0 lib/core/facets/string/mscan.rb
facets-2.5.1 lib/core/facets/string/mscan.rb
facets-2.5.0 lib/core/facets/string/mscan.rb
facets-2.5.2 lib/core/facets/string/mscan.rb