Flowdock
method

names

Importance_1
Ruby latest stable (v1_9_3_392) - 0 notes - Class: MatchData
names() public

Returns a list of names of captures as an array of strings. It is same as mtch.regexp.names.

/(?<foo>.)(?<bar>.)(?<baz>.)/.match("hoge").names
#=> ["foo", "bar", "baz"]

m = /(?<x>.)(?<y>.)?/.match("a") #=> #<MatchData "a" x:"a" y:nil>
m.names                          #=> ["x", "y"]
Show source
Register or log in to add new notes.