This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.

match

        # String.match

(from ruby core)
---
    match(pattern, offset = 0) -> matchdata or nil
    match(pattern, offset = 0) {|matchdata| ... } -> object

---

Returns a Matchdata object (or `nil`) based on `self` and the given
`pattern`.

Note: also updates [Regexp-related global
variables](Regexp.html#class-Regexp-label-Special+global+variables).

*   Computes `regexp` by converting `pattern` (if not already a Regexp).
        regexp = Regexp.new(pattern)

*   Computes `matchdata`, which will be either a MatchData object or
    `nil` (see Regexp#match):
        matchdata = <tt>regexp.match(self)


With no block given, returns the computed `matchdata`:

    'foo'.match('f') # => #<MatchData "f">
    'foo'.match('o') # => #<MatchData "o">
    'foo'.match('x') # => nil

If Integer argument `offset` is given, the search begins at index
`offset`:

    'foo'.match('f', 1) # => nil
    'foo'.match('o', 1) # => #<MatchData "o">

With a block given, calls the block with the computed `matchdata` and
returns the block's return value:

    'foo'.match(/o/) {|matchdata| matchdata } # => #<MatchData "o">
    'foo'.match(/x/) {|matchdata| matchdata } # => nil
    'foo'.match(/f/, 1) {|matchdata| matchdata } # => nil



      

This is MURDOC! A Ruby documentation browser inspired by Smalltalk-80. It allows you to learn about Ruby by browsing through its class hierarchies, and see any of its methods.