hash

mtch.hash â integer Instance Public methods Produce a hash based on the target string, regexp and matched positions of this matchdata.

eql?

mtch == mtch2 â true or false Instance Public methods EqualityâTwo matchdata are equal if their target strings, patterns, and matched positions are identical.

end

mtch.end(n) â integer Instance Public methods Returns the offset of the character immediately following the end of the nth element of the match array in the string. n can be a string or symbol to reference a named capture. m = /(.)(.)(\d+)(\d)/.match("THX1138.") m.end(0) #=> 7 m.end(2) #=> 3 m = /(?<foo>.)(.)(?<bar>.)/.match("hoge") p m.end(:foo) #=> 1 p m.end(:bar) #=> 3

captures

mtch.captures â array Instance Public methods Returns the array of captures; equivalent to mtch.to_a[1..-1]. f1,f2,f3,f4 = /(.)(.)(\d+)(\d)/.match("THX1138.").captures f1 #=> "H" f2 #=> "X" f3 #=> "113" f4 #=> "8"

begin

mtch.begin(n) â integer Instance Public methods Returns the offset of the start of the nth element of the match array in the string. n can be a string or symbol to reference a named capture. m = /(.)(.)(\d+)(\d)/.match("THX1138.") m.begin(0) #=> 1 m.begin(2) #=> 2 m = /(?<foo>.)(.)(?<bar>.)/.match("hoge") p m.begin(:foo) #=> 0 p m.begin(:bar) #=> 2

[]

mtch[i] â str or nilmtch[start, length] â arraymtch[range] â arraymtch[name] â str or nil Instance Public methods Match Reference â MatchData acts as an array, and may be accessed using the normal array indexing techniques. mtch[0] is equivalent to the special variable $&, and returns the entire matched string. mtch[1], mtch[2], and so on return the values of the matched backreferences (portions of the pattern between parentheses). m = /(

==

mtch == mtch2 â true or false Instance Public methods EqualityâTwo matchdata are equal if their target strings, patterns, and matched positions are identical.

restore

restore( source [, proc] ) â obj Class Public methods Returns the result of converting the serialized data in source into a Ruby object (possibly with associated subordinate objects). source may be either an instance of IO or an object that responds to to_str. If proc is specified, it will be passed each object as it is deserialized. Never pass untrusted data (including user supplied input) to this method. Please see the overview for further details.

load

load( source [, proc] ) â obj Class Public methods Returns the result of converting the serialized data in source into a Ruby object (possibly with associated subordinate objects). source may be either an instance of IO or an object that responds to to_str. If proc is specified, it will be passed each object as it is deserialized. Never pass untrusted data (including user supplied input) to this method. Please see the overview for further details.

dump

dump( obj [, anIO] , limit=-1 ) â anIO Class Public methods Serializes obj and all descendant objects. If anIO is specified, the serialized data will be written to it, otherwise the data will be returned as a String. If limit is specified, the traversal of subobjects will be limited to that depth. If limit is negative, no checking of depth will be performed. class Klass def initialize(str) @str = str end def say_hello @str end end (produces no output) o = Klass.ne